good morning!!!!

Skip to content
Snippets Groups Projects
Unverified Commit 73725ca9 authored by Igor Mandrigin's avatar Igor Mandrigin Committed by GitHub
Browse files

Support XDG_DATA_DIR on Linux (#842)

* Support XDG_DATA_DIR

* make linter happy
parent 19583b90
No related branches found
No related tags found
No related merge requests found
......@@ -17,7 +17,6 @@
package node
import (
"fmt"
"os"
"os/user"
"path/filepath"
......@@ -78,7 +77,10 @@ func DefaultDataDir() string {
}
return filepath.Join(appdata, dirname)
default:
return filepath.Join(home, fmt.Sprintf(".%s", strings.ToLower(dirname)))
if xdgDataDir := os.Getenv("XDG_DATA_HOME"); xdgDataDir != "" {
return filepath.Join(xdgDataDir, strings.ToLower(dirname))
}
return filepath.Join(home, ".local/share", strings.ToLower(dirname))
}
}
// As we cannot guess a stable location, return empty and handle later
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment