From 85acfcd6bd7bb6d3979d613c1215b2edf10a6faf Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Wed, 12 Jul 2017 20:31:33 -0400 Subject: [PATCH] Only clean if the file exists --- tests/install-darwin.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/install-darwin.sh b/tests/install-darwin.sh index 9084d92c..b553f710 100755 --- a/tests/install-darwin.sh +++ b/tests/install-darwin.sh @@ -20,8 +20,10 @@ cleanup() { done for file in ~/.bash_profile ~/.bash_login ~/.profile ~/.zshenv ~/.zprofile ~/.zshrc ~/.zlogin; do - cat "$file" | grep -v nix-profile > "$file.next" - mv "$file.next" "$file" + if [ -e "$file" ]; then + cat "$file" | grep -v nix-profile > "$file.next" + mv "$file.next" "$file" + fi done