Skip to content
This repository has been archived by the owner on Dec 9, 2023. It is now read-only.

Commit

Permalink
Fix filepaths for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Phantas0s committed Nov 24, 2020
1 parent d7683cc commit 2f3f8bc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 2f3f8bc

Please sign in to comment.