Skip to content

Commit

Permalink
Fix "unbound variable" errors in bash
Browse files Browse the repository at this point in the history
  • Loading branch information
iFreilicht committed Nov 21, 2023
1 parent c185e45 commit 6482736
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scripts/nix-profile-daemon.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fi
export NIX_PROFILES="@localstatedir@/nix/profiles/default $NIX_LINK"

# Populate bash completions, .desktop files, etc
if [ -z "$XDG_DATA_DIRS" ]; then
if [ -z "${XDG_DATA_DIRS-}" ]; then
# According to XDG spec the default is /usr/local/share:/usr/share, don't set something that prevents that default
export XDG_DATA_DIRS="/usr/local/share:/usr/share:$NIX_LINK/share:/nix/var/nix/profiles/default/share"
else
Expand Down
2 changes: 1 addition & 1 deletion scripts/nix-profile.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if [ -n "$HOME" ] && [ -n "$USER" ]; then
export NIX_PROFILES="@localstatedir@/nix/profiles/default $NIX_LINK"

# Populate bash completions, .desktop files, etc
if [ -z "$XDG_DATA_DIRS" ]; then
if [ -z "${XDG_DATA_DIRS-}" ]; then
# According to XDG spec the default is /usr/local/share:/usr/share, don't set something that prevents that default
export XDG_DATA_DIRS="/usr/local/share:/usr/share:$NIX_LINK/share:/nix/var/nix/profiles/default/share"
else
Expand Down

0 comments on commit 6482736

Please sign in to comment.