-
Notifications
You must be signed in to change notification settings - Fork 71
Change default install path to $XDG_DATA_HOME/zigup on non-Windows systems #178
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
Change default install path to $XDG_DATA_HOME/zigup on non-Windows systems #178
Conversation
2cd9ec5
to
258aed2
Compare
258aed2 built with zig 0.14 and tested on my Debian 12 machine. If there's interest it would be probably less of a hassle to change it on Windows as well, but I don't know Windows conventions, and especially I don't know a good-enough way how to get a "good" default programmaticaclly (presumably without extra dependencies such as known_paths). So if anyone wants to provide a snippet and test it, I'm willing to include it, but it might just be easier to do it in another PR. |
Instead of hardcoding it, could you check |
I have prepared implementation which prefers and handles XDG_DATA_HOME properly, but in the meantime I've found a bug, which actually affects even the current implementation. zigup will not create parent directories when creating the installdir, so ~/.local/share/zigup will fail if ~/.local/share does not already exist. I'm not sure if stdlib has an easy option on auto-creating parent dirs. |
OK, turns out there's not a function for it but it's relatively straightforward using So, updating the PR: I've replaced Again, I can't test this on Windows, but
|
258aed2
to
5fffe8c
Compare
5fffe8c built with zig 0.14 and tested on my Debian 12 machine:
|
5fffe8c
to
01c9a8d
Compare
So I've replaced my implementation with Re-tested:
|
Couple notes:
|
…stems Fixes marler8997#177. Also related to discussion in marler8997#146. Windows path is not changed because currently on Windows the path is derived from the location of the binary, so assuming Windows does not allow two identcal paths, the most logical path name, `zigup`, is not available. I don't know about Windows conventions and don't have a Windows machine available to be able to test my assumptions.
error.AlreadyReported just means exit with 1 withot printing any more errors.
01c9a8d
to
5012a6f
Compare
I considered few names but ended up adding
Don't have a strong opinion but ti me they seem worth keeping as an extra safeguard... So I kept them and replaced errors with
done! |
Fixes #177. Also related to discussion in #146.
Windows path is not changed because currently on Windows the path is derived from the location of the binary, so assuming Windows does not allow two identcal paths, the most logical path name,
zigup
, is not available.I don't know about Windows conventions and don't have a Windows machine available to be able to test my assumptions.