forked from lix-project/lix
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.
This commit is contained in:
parent
2921165a9d
commit
4ba91f5bae
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue