mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 08:16:15 +02:00
Only clean if the file exists
This commit is contained in:
parent
92ca93528f
commit
3839dda2ec
1 changed files with 4 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue