diff options
author | Graham Christensen <graham@grahamc.com> | 2017-07-13T00·31-0400 |
---|---|---|
committer | Graham Christensen <graham@grahamc.com> | 2017-07-14T16·11-0400 |
commit | 3839dda2ecc0444db1469757b4a3e1f4f776fe9d (patch) | |
tree | 647d68e329d252eefaccfe85d46f979d252f385b /tests | |
parent | 92ca93528fe7d29b8909a89b0f9c7a9e23627fd5 (diff) |
Only clean if the file exists
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/install-darwin.sh | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/install-darwin.sh b/tests/install-darwin.sh index 9084d92c23e1..b553f710527d 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 |