Fix order of reading environment variables
This commit is contained in:
parent
baddce264f
commit
172d18470f
4
main.go
4
main.go
@ -122,9 +122,9 @@ func UserDataDir() (dir string, err error) {
|
|||||||
if runtime.GOOS == "windows" || runtime.GOOS == "darwin" {
|
if runtime.GOOS == "windows" || runtime.GOOS == "darwin" {
|
||||||
return UserConfigDir()
|
return UserConfigDir()
|
||||||
}
|
}
|
||||||
dir = os.Getenv("XDG_DATA_HOME")
|
dir = getRootDir("data")
|
||||||
if dir == "" {
|
if dir == "" {
|
||||||
dir = getRootDir("data")
|
dir = os.Getenv("XDG_DATA_HOME")
|
||||||
}
|
}
|
||||||
if dir == "" {
|
if dir == "" {
|
||||||
dir = os.Getenv("HOME")
|
dir = os.Getenv("HOME")
|
||||||
|
Loading…
Reference in New Issue
Block a user