about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-07-25T15·46+0200
committerGitHub <noreply@github.com>2019-07-25T15·46+0200
commit1fb8e2605ad4779013fc75f6a98362df74af535b (patch)
tree5f5c6b2be25a5b3fe2678b0372dad0b5d11aa2cb
parentb640f69a4d33eb3833cf0ac3000d189dacbd0f5a (diff)
parentc82a856b36bcd008edeb9c4c981b974ae642afea (diff)
Merge pull request #3007 from matthewbauer/add-user-default
Add default for USER when unset
-rw-r--r--scripts/install-nix-from-closure.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/install-nix-from-closure.sh b/scripts/install-nix-from-closure.sh
index fc999d336d1f..35926f3dac94 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