Skip to content

Commit

Permalink
Don't try to set empty keys
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamc committed Nov 22, 2023
1 parent 7663d83 commit f072444
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/action/common/profiles/profile.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
# shellcheck shell=sh
if [ -f /nix/nix-installer ] && [ -x /nix/nix-installer ] && [ -z "${__ETC_PROFILE_NIX_SOURCED:-}" ]; then
NIX_INSTALLER_EXPORT_DATA=$(/nix/nix-installer export --verbose --verbose --format space-newline-separated);
while read -r nix_installer_export_key nix_installer_export_value; do
export "$nix_installer_export_key=$nix_installer_export_value";
done <<DATA_INPUT
$NIX_INSTALLER_EXPORT_DATA
if NIX_INSTALLER_EXPORT_DATA=$(/nix/nix-installer export --format space-newline-separated); then
while read -r nix_installer_export_key nix_installer_export_value; do
if [ -n "$nix_installer_export_key" ]; then
export "$nix_installer_export_key=$nix_installer_export_value";
fi
done <<DATA_INPUT
$NIX_INSTALLER_EXPORT_DATA
DATA_INPUT
unset nix_installer_export_key nix_installer_export_value
fi

unset NIX_INSTALLER_EXPORT_DATA nix_installer_export_key nix_installer_export_value
unset NIX_INSTALLER_EXPORT_DATA
fi

0 comments on commit f072444

Please sign in to comment.