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" {
|
||||
return UserConfigDir()
|
||||
}
|
||||
dir = os.Getenv("XDG_DATA_HOME")
|
||||
if dir == "" {
|
||||
dir = getRootDir("data")
|
||||
if dir == "" {
|
||||
dir = os.Getenv("XDG_DATA_HOME")
|
||||
}
|
||||
if dir == "" {
|
||||
dir = os.Getenv("HOME")
|
||||
|
Loading…
Reference in New Issue
Block a user