diff options
author | Matthew Bauer <mjbauer95@gmail.com> | 2019-07-25 09:39:44 -0400 |
---|---|---|
committer | Matthew Bauer <mjbauer95@gmail.com> | 2019-07-25 09:39:44 -0400 |
commit | c82a856b36bcd008edeb9c4c981b974ae642afea (patch) | |
tree | 5f5c6b2be25a5b3fe2678b0372dad0b5d11aa2cb /scripts/install-nix-from-closure.sh | |
parent | b640f69a4d33eb3833cf0ac3000d189dacbd0f5a (diff) |
Add default for USER when unset
uses $(id -u -n) when USER is unset, this is needed on some weird
setups in Docker. Fixes #971
Diffstat (limited to 'scripts/install-nix-from-closure.sh')
-rw-r--r-- | scripts/install-nix-from-closure.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/install-nix-from-closure.sh b/scripts/install-nix-from-closure.sh index fc999d336..35926f3da 100644 --- a/scripts/install-nix-from-closure.sh +++ b/scripts/install-nix-from-closure.sh @@ -12,7 +12,7 @@ if ! [ -e "$self/.reginfo" ]; then echo "$0: incomplete installer (.reginfo is missing)" >&2 fi -if [ -z "$USER" ]; then +if [ -z "$USER" ] && ! USER=$(id -u -n); then echo "$0: \$USER is not set" >&2 exit 1 fi |