Only clean if the file exists
This commit is contained in:
parent
b2917c8246
commit
85acfcd6bd
|
@ -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 New Issue