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

Add support for non-default XDG user dir in an install script for the Linux #767

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Toreno96
Copy link

@Toreno96 Toreno96 commented Nov 8, 2022

According to the https://wiki.archlinux.org/title/XDG_user_directories and https://www.freedesktop.org/wiki/Software/xdg-user-dirs/, Linux users can customize their "user directories" to be in a different paths than the default ~/Downloads etc. However, the install script hardcoded this path so far, which caused a failure for such users, e.g.

$ ./install/linux.sh 
/home/dstasczak/Downloads/kinto.zip: No such file or directory
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
Warning: Failed to open the file /home/dstasczak/Downloads/kinto.zip: No such 
Warning: file or directory
100   512    0   512    0     0    751      0 --:--:-- --:--:-- --:--:--   751
curl: (23) Failure writing output to destination
unzip:  cannot find or open /home/dstasczak/Downloads/kinto.zip, /home/dstasczak/Downloads/kinto.zip.zip or /home/dstasczak/Downloads/kinto.zip.ZIP.
…

This PR is supposed to fix that.

In case the fallback hardcoded path is used, there will be an error message written to the STDERR:

$ ./install/linux.sh 
./install/linux.sh: line 7: xdg-user-dir: command not found

This is the default error message that bash shows in case it cannot find a specific command, I think it's clear enough not to require implementing any custom handling. Let me know if you agree or not 🙂

In an install script for the Linux.

According to the <https://wiki.archlinux.org/title/XDG_user_directories>
and <https://www.freedesktop.org/wiki/Software/xdg-user-dirs/>, Linux
users can customize their "user directories" to be in a different paths
than the default `~/Downloads` etc. _However_, the install script
hardcoded this path so far, which caused a failure for such users. This
commit is supposed to fix that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant