6088d1e8eb
* feat: parallel downloads * feat: mod extract progress using file size * feat: pass mod version in install progress updates * fix: only close update channels after finished sending * chore: verbose ci tests * fix: store mod in cache chore: add progress logging to tests * chore: lint * test: add concurrent download limit * fix: prevent concurrent map access * chore: bump pubgrub fix: fix race conditions --------- Co-authored-by: Vilsol <me@vil.so>
21 lines
762 B
Go
21 lines
762 B
Go
package cfg
|
|
|
|
import (
|
|
"path/filepath"
|
|
"runtime"
|
|
|
|
"github.com/spf13/viper"
|
|
)
|
|
|
|
func SetDefaults() {
|
|
_, file, _, _ := runtime.Caller(0)
|
|
viper.SetDefault("cache-dir", filepath.Clean(filepath.Join(filepath.Dir(file), "../", "testdata", "cache")))
|
|
viper.SetDefault("local-dir", filepath.Clean(filepath.Join(filepath.Dir(file), "../", "testdata", "local")))
|
|
viper.SetDefault("base-local-dir", filepath.Clean(filepath.Join(filepath.Dir(file), "../", "testdata")))
|
|
viper.SetDefault("profiles-file", "profiles.json")
|
|
viper.SetDefault("installations-file", "installations.json")
|
|
viper.SetDefault("dry-run", false)
|
|
viper.SetDefault("api-base", "https://api.ficsit.app")
|
|
viper.SetDefault("graphql-api", "/v2/query")
|
|
viper.SetDefault("concurrent-downloads", 5)
|
|
}
|