Updates the XDG path creation to create needed dirs and panic on failure
This commit is contained in:
parent
c6cab8220a
commit
2900702313
|
@ -71,7 +71,12 @@ func homePath() string {
|
||||||
func xdgConfigPath() string {
|
func xdgConfigPath() string {
|
||||||
configPath := os.Getenv("XDG_CONFIG_HOME")
|
configPath := os.Getenv("XDG_CONFIG_HOME")
|
||||||
if configPath == "" {
|
if configPath == "" {
|
||||||
return filepath.Join(homePath(), ".config")
|
fp := filepath.Join(homePath(), ".config")
|
||||||
|
err := os.MkdirAll(fp, 0755)
|
||||||
|
if err != nil {
|
||||||
|
panic("Unable to create configuration directory: ~/.config")
|
||||||
|
}
|
||||||
|
return fp
|
||||||
}
|
}
|
||||||
return configPath
|
return configPath
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue