From 172d18470fe43eea14c32ec0ccea6537771499f7 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Wed, 16 Feb 2022 19:37:11 +0200 Subject: [PATCH] Fix order of reading environment variables --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 4792599..5dfc801 100644 --- a/main.go +++ b/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") + dir = getRootDir("data") if dir == "" { - dir = getRootDir("data") + dir = os.Getenv("XDG_DATA_HOME") } if dir == "" { dir = os.Getenv("HOME")