forked from lix-project/lix
Only clean if the file exists
This commit is contained in:
parent
92ca93528f
commit
3839dda2ec
|
@ -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…
Reference in a new issue