mirror of
https://github.com/Warky-Devs/vecna.git
synced 2026-05-05 01:26:58 +00:00
feat(docker): add configurable path for vecna.json
* set default config path to /config * update docker-compose example for config usage * modify config resolution to include /config directory
This commit is contained in:
@@ -79,7 +79,7 @@ func ResolveFile(cfgFile string) string {
|
||||
return cfgFile
|
||||
}
|
||||
home, _ := os.UserHomeDir()
|
||||
dirs := []string{".", home, home + "/.config/vecna"}
|
||||
dirs := []string{"/config", ".", home, home + "/.config/vecna"}
|
||||
for _, dir := range dirs {
|
||||
for _, ext := range extensions {
|
||||
path := dir + "/vecna." + ext
|
||||
@@ -117,6 +117,7 @@ func Load(cfgFile string) (*Config, error) {
|
||||
home, _ := os.UserHomeDir()
|
||||
v.SetConfigName("vecna")
|
||||
// No SetConfigType — viper detects format from file extension (json, yaml, toml, etc.)
|
||||
v.AddConfigPath("/config")
|
||||
v.AddConfigPath(".")
|
||||
v.AddConfigPath(home)
|
||||
v.AddConfigPath(home + "/.config/vecna")
|
||||
|
||||
Reference in New Issue
Block a user