mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-14 16:13:44 +08:00
fix(uninstall): keep ~/.zshrc if no backup exists
This commit is contained in:
parent
9e23925b85
commit
9000e673cd
@ -22,9 +22,14 @@ if [ -d ~/.oh-my-zsh ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -e ~/.zshrc ]; then
|
if [ -e ~/.zshrc ]; then
|
||||||
|
ZSHRC_ORIG=~/.zshrc.pre-oh-my-zsh
|
||||||
|
if [ -e "$ZSHRC_ORIG" ]; then
|
||||||
ZSHRC_SAVE=~/.zshrc.omz-uninstalled-$(date +%Y-%m-%d_%H-%M-%S)
|
ZSHRC_SAVE=~/.zshrc.omz-uninstalled-$(date +%Y-%m-%d_%H-%M-%S)
|
||||||
echo "Found ~/.zshrc -- Renaming to ${ZSHRC_SAVE}"
|
echo "Found ~/.zshrc -- Renaming to ${ZSHRC_SAVE}"
|
||||||
mv ~/.zshrc "${ZSHRC_SAVE}"
|
mv ~/.zshrc "${ZSHRC_SAVE}"
|
||||||
|
else
|
||||||
|
echo "Found ~/.zshrc but no backup config detected -- leaving it untouched"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Looking for original zsh config..."
|
echo "Looking for original zsh config..."
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user