diff options
author | matthieu <matthieu.cneude@gmail.com> | 2020-11-24 12:48:00 +0100 |
---|---|---|
committer | matthieu <matthieu.cneude@gmail.com> | 2020-11-24 12:48:00 +0100 |
commit | 2f3f8bcf3a059d464b42a3262e0b10c59ac8be27 (patch) | |
tree | b410c1993c7d122793ad11e3aa1905d5a54ee2ab | |
parent | d7683cc842825daa370a5f61aab1c4e0ca327e3a (diff) |
Fix filepaths for windowsv0.4.1
-rw-r--r-- | cmd/config.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd/config.go b/cmd/config.go index d5fda16..e584254 100644 --- a/cmd/config.go +++ b/cmd/config.go @@ -172,14 +172,14 @@ func mapConfig(cfgFile string) config { } if cfgFile == "" { - defaultPath := home + "/.config/devdash/" + defaultPath := filepath.Join(home, ".config", "devdash") cfgFile = defaultConfig(defaultPath, "default.yml") } // viper.AddConfigPath(home) viper.AddConfigPath(".") - viper.AddConfigPath("$XDG_CONFIG_HOME/devdash/") - viper.AddConfigPath(home + "/.config/devdash/") + viper.AddConfigPath(filepath.Join("$XDG_CONFIG_HOME", "devdash")) + viper.AddConfigPath(filepath.Join(home, ".config", "devdash")) viper.SetConfigName(removeExt(cfgFile)) err = viper.ReadInConfig() @@ -210,7 +210,7 @@ func defaultConfig(path string, filename string) string { os.MkdirAll(path, 0755) } - f := path + filename + f := filepath.Join(path, filename) if _, err := os.Stat(f); os.IsNotExist(err) { file, _ := os.Create(f) defer file.Close() |