Skip to content

Commit

Permalink
ensure fallback path is always set
Browse files Browse the repository at this point in the history
  • Loading branch information
bcicen committed Apr 25, 2017
1 parent a00d195 commit 8adb95e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,14 @@ func getConfigPath() (path string, exists bool) {
exitErr(fmt.Errorf("$HOME not set"))
}

path = fmt.Sprintf("%s/.slackcat", userHome) // default path

if xdgSupport() {
xdgHome, ok := os.LookupEnv("XDG_CONFIG_HOME")
if !ok {
xdgHome = fmt.Sprintf("%s/.config", userHome)
}
path = fmt.Sprintf("%s/slackcat/config", xdgHome)
} else {
path = fmt.Sprintf("%s/.slackcat", userHome)
}

if _, err := os.Stat(path); err == nil {
Expand Down

0 comments on commit 8adb95e

Please sign in to comment.