1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-14 22:42:41 +01:00

Only clean if the file exists

This commit is contained in:
Graham Christensen 2017-07-12 20:31:33 -04:00
parent b2917c8246
commit 85acfcd6bd
No known key found for this signature in database
GPG key ID: 06121D366FE9435C

View file

@ -20,8 +20,10 @@ cleanup() {
done done
for file in ~/.bash_profile ~/.bash_login ~/.profile ~/.zshenv ~/.zprofile ~/.zshrc ~/.zlogin; do for file in ~/.bash_profile ~/.bash_login ~/.profile ~/.zshenv ~/.zprofile ~/.zshrc ~/.zlogin; do
cat "$file" | grep -v nix-profile > "$file.next" if [ -e "$file" ]; then
mv "$file.next" "$file" cat "$file" | grep -v nix-profile > "$file.next"
mv "$file.next" "$file"
fi
done done