about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorGraham Christensen <graham@grahamc.com>2017-07-13T00·31-0400
committerGraham Christensen <graham@grahamc.com>2017-07-14T16·11-0400
commit3839dda2ecc0444db1469757b4a3e1f4f776fe9d (patch)
tree647d68e329d252eefaccfe85d46f979d252f385b /tests
parent92ca93528fe7d29b8909a89b0f9c7a9e23627fd5 (diff)
Only clean if the file exists
Diffstat (limited to 'tests')
-rwxr-xr-xtests/install-darwin.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/install-darwin.sh b/tests/install-darwin.sh
index 9084d92c23..b553f71052 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