aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGraham Christensen <graham@grahamc.com>2017-07-12 20:31:33 -0400
committerGraham Christensen <graham@grahamc.com>2017-07-14 12:11:17 -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 9084d92c2..b553f7105 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