Skip to content

Commit

Permalink
feat: support XDG_CONFIG_HOME
Browse files Browse the repository at this point in the history
Co-authored-by: Brennan Fee <[email protected]>
  • Loading branch information
mistydemeo and brennanfee committed Dec 18, 2024
1 parent 7872825 commit 235127f
Show file tree
Hide file tree
Showing 48 changed files with 253 additions and 89 deletions.
6 changes: 5 additions & 1 deletion cargo-dist/templates/installer/installer.ps1.j2
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ if ($env:INSTALLER_DOWNLOAD_URL) {
$receipt = @"
{{ receipt | tojson }}
"@
$receipt_home = "${env:LOCALAPPDATA}\{{ app_name }}"
if ($env:XDG_CONFIG_HOME) {
$receipt_home = "${env:XDG_CONFIG_HOME}\{{ app_name }}"
} else {
$receipt_home = "${env:LOCALAPPDATA}\{{ app_name }}"
}

if ($env:{{ env_vars.disable_update_env_var }}) {
$install_updater = $false
Expand Down
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 @@ -54,7 +54,7 @@ fi
read -r RECEIPT <<EORECEIPT
{{ receipt | tojson }}
EORECEIPT
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
8 changes: 6 additions & 2 deletions cargo-dist/tests/snapshots/akaikatana_basic.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cargo-dist/tests/snapshots/akaikatana_musl.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions cargo-dist/tests/snapshots/akaikatana_two_bin_aliases.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions cargo-dist/tests/snapshots/akaikatana_updaters.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions cargo-dist/tests/snapshots/axolotlsay_abyss.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions cargo-dist/tests/snapshots/axolotlsay_abyss_only.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions cargo-dist/tests/snapshots/axolotlsay_alias.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions cargo-dist/tests/snapshots/axolotlsay_basic.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions cargo-dist/tests/snapshots/axolotlsay_basic_lies.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions cargo-dist/tests/snapshots/axolotlsay_build_setup_steps.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 235127f

Please sign in to comment.