Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use local share directory on unix like systems #603

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/haxelib/api/RepoManager.hx
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,14 @@ class RepoManager {
if (IS_WINDOWS)
return getWindowsDefaultGlobalPath();

// TODO `lib/` is for binaries, see if we can move all of these to `share/`
final dataHome = Sys.getEnv("XDG_DATA_HOME");
if (dataHome != null) {
return dataHome + '/haxe/$REPO_DIR/';
}
final home = Sys.getEnv("HOME");
if (home != null) {
return home + '/.local/share/haxe/$REPO_DIR/';
}
return if (FileSystem.exists("/usr/share/haxe/")) // for Debian
'/usr/share/haxe/$REPO_DIR/'
else if (Sys.systemName() == "Mac") // for newer OSX, where /usr/lib is not writable
Expand Down