about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2019-07-25T13·39-0400
committerMatthew Bauer <mjbauer95@gmail.com>2019-07-25T13·39-0400
commitc82a856b36bcd008edeb9c4c981b974ae642afea (patch)
tree5f5c6b2be25a5b3fe2678b0372dad0b5d11aa2cb
parentb640f69a4d33eb3833cf0ac3000d189dacbd0f5a (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
-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