2672b17f44
* feat: sftp test: add tests for ftp and sftp * chore: ci fixes * chore: potential race fix * fix: simplify existence checks * fix: split path differently for ftp * fix: 🤷 * chore: add debug print * chore: lint * chore: idk dude * chore: ? * chore: more logs * chore: wipe mods before tests * chore: logs * chore: wat * chore: wait? * chore: no errors * chore: gh actions are 💩 * fix: always sync after copy * chore: remove some test logs * chore: remove test progress watcher * refactor: change progress to writer * chore: logs * chore: different logs * chore: whoops * chore: moar logs * chore: even moar logs * chore: what is life * chore: why are we here * chore: we are just bags of water floating through space * chore: are you real? * chore: ? * chore: if you get a single update now I call bs * chore: ok what if we just do one? * chore: ok what if we do two? * chore: this should not work * chore: wait no, this one * chore: fml * chore: remove logs * chore: what if we just wait a little * chore: retry * chore: move error * chore: verbose log * chore: remove explicit sleep * chore: remove debug * fix: linux pathing on windows * fix: clean paths properly * fix: fuck ftp * fix: send update on vanilla * feat: parallel ftp * fix: remove potential credential leak
27 lines
892 B
Go
27 lines
892 B
Go
package cfg
|
|
|
|
import (
|
|
"log/slog"
|
|
"os"
|
|
"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.dev")
|
|
viper.SetDefault("graphql-api", "/v2/query")
|
|
viper.SetDefault("concurrent-downloads", 5)
|
|
|
|
slog.SetDefault(slog.New(slog.NewTextHandler(os.Stderr, &slog.HandlerOptions{
|
|
Level: slog.LevelDebug,
|
|
})))
|
|
}
|