From 4ba91f5baefb3d6f187a72505a4a763c35db7b96 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Fri, 30 Mar 2018 11:37:32 -0400 Subject: [PATCH] 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. --- scripts/install-multi-user.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install-multi-user.sh b/scripts/install-multi-user.sh index 0e9500a98..411de31f4 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 <