Skip to content

Commit

Permalink
refactor: follow XDG spec more closely
Browse files Browse the repository at this point in the history
  • Loading branch information
dpastoor committed May 29, 2022
1 parent 1f17a81 commit 3029ed3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions internal/config/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@ func GetConfigPath() (string, error) {
func GetRootConfigPath() string {
return filepath.Join(xdg.ConfigHome, "qvm")
}
func GetRootDataPath() string {
return filepath.Join(xdg.DataHome, "qvm")
}

func GetPathToActiveBinDir() string {
return filepath.Join(xdg.DataHome, "qvm", "active", "bin")
return filepath.Join(xdg.ConfigHome, "qvm", "bin")
}

func GetPathToVersionsDir() string {
return filepath.Join(xdg.ConfigHome, "qvm", "versions")
return filepath.Join(xdg.DataHome, "qvm", "versions")
}

// GetInstalledVersions returns a map of installed versions where they key is the version
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func main() {
if runtime.GOOS == "darwin" {
hd, _ := os.UserHomeDir()
os.Setenv("XDG_CONFIG_HOME", filepath.Join(hd, ".config"))
os.Setenv("XDG_DATA_HOME", filepath.Join(hd, ".config"))
os.Setenv("XDG_DATA_HOME", filepath.Join(hd, ".local", "share"))
xdg.Reload()
}
cmd.Execute(version, os.Args[1:])
Expand Down

0 comments on commit 3029ed3

Please sign in to comment.