about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGraham Christensen <graham@grahamc.com>2018-03-30T15·37-0400
committerGraham Christensen <graham@grahamc.com>2018-03-30T15·37-0400
commit4ba91f5baefb3d6f187a72505a4a763c35db7b96 (patch)
treee1c1df061e45258972de3381441dde1829d1d7be
parent2921165a9d14b80fd4a7e350e72ec2b83791682c (diff)
Check for the existence of a profile target before seeing if it mentions Nix
Grep would ignore files that didn't exist, but would complain
about files in a directory if the directory didn't exist. Simply check
for the directory first, prior to grepping it.
-rw-r--r--scripts/install-multi-user.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/install-multi-user.sh b/scripts/install-multi-user.sh
index 0e9500a98eb0..411de31f4cde 100644
--- a/scripts/install-multi-user.sh
+++ b/scripts/install-multi-user.sh
@@ -369,7 +369,7 @@ and try again.
 EOF
         fi
 
-        if grep -qi "nix" "$profile_target"; then
+        if [ -e "$profile_target" ] && grep -qi "nix" "$profile_target"; then
             failure <<EOF
 It looks like $profile_target already has some Nix configuration in
 there. There should be no reason to run this again. If you're having