mirror of
https://github.com/NixOS/nix.git
synced 2025-11-15 15:02:42 +01:00
Only clean if the file exists
This commit is contained in:
parent
b2917c8246
commit
85acfcd6bd
1 changed files with 4 additions and 2 deletions
|
|
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue