Skip to content

Commit

Permalink
fix: Make RECEIPT_HOME variable XDG compliant
Browse files Browse the repository at this point in the history
The setting of RECEIPT_HOME using "${HOME}/.config" will fail for users
who move their config folder elsewhere using XDG_CONFIG_HOME. Both dash
and bash (the usual interpreters for /bin/sh) both support parameter
substitution.
  • Loading branch information
brennanfee committed Aug 22, 2024
1 parent 921905e commit 174b029
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cargo-dist/templates/installer/installer.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ read -r RECEIPT <<EORECEIPT
{{ receipt | tojson }}
EORECEIPT
# Are we happy with this same path on Linux and Mac?
RECEIPT_HOME="${HOME}/.config/{{ app_name }}"
RECEIPT_HOME="${XDG_CONFIG_HOME:-$HOME/.config}/{{ app_name }}"

usage() {
# print help (this cat/EOF stuff is a "heredoc" string)
Expand Down

0 comments on commit 174b029

Please sign in to comment.