diff --git a/main.go b/main.go index 65254ca..8848ae3 100644 --- a/main.go +++ b/main.go @@ -36,18 +36,18 @@ var ( func main() { homedir, _ = os.UserHomeDir() - confDir = getenv("XDG_CONFIG_HOME", homedir + "/.config") + confDir = getenv("XDG_CONFIG_HOME", homedir + "/.config") curuser, _ = user.Current() preloadPath = strings.Replace(preloadPath, "~", homedir, 1) sampleConfPath = strings.Replace(sampleConfPath, "~", homedir, 1) if defaultConfDir == "" { // we'll add *our* default if its empty (wont be if its changed comptime) - if _, err := os.Stat(filepath.Join(confDir, "hilbish", "hilbishrc.lua")); os.IsNotExist(err) { - defaultConfPath = filepath.Join(homedir, "/.hilbishrc.lua") - } else { - defaultConfPath = filepath.Join(confDir, "hilbish", "hilbishrc.lua") - } + if _, err := os.Stat(filepath.Join(confDir, "hilbish", "hilbishrc.lua")); os.IsNotExist(err) { + defaultConfPath = filepath.Join(homedir, "/.hilbishrc.lua") + } else { + defaultConfPath = filepath.Join(confDir, "hilbish", "hilbishrc.lua") + } } else { // else do ~ substitution defaultConfPath = filepath.Join(strings.Replace(defaultConfDir, "~", homedir, 1), ".hilbishrc.lua")