Skip to content

Commit

Permalink
Check for the existence of a profile target before seeing if it menti…
Browse files Browse the repository at this point in the history
…ons 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.
  • Loading branch information
grahamc committed Mar 30, 2018
1 parent 2921165 commit 4ba91f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/install-multi-user.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4ba91f5

Please sign in to comment.