summaryrefslogtreecommitdiff
path: root/tools/uninstall.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tools/uninstall.sh')
-rw-r--r--tools/uninstall.sh15
1 files changed, 8 insertions, 7 deletions
diff --git a/tools/uninstall.sh b/tools/uninstall.sh
index bf2244be8..9793be2a1 100644
--- a/tools/uninstall.sh
+++ b/tools/uninstall.sh
@@ -10,16 +10,17 @@ if [ -d ~/.oh-my-zsh ]; then
fi
echo "Looking for original zsh config..."
-if [ -f ~/.zshrc.pre-oh-my-zsh ] || [ -h ~/.zshrc.pre-oh-my-zsh ]; then
- echo "Found ~/.zshrc.pre-oh-my-zsh -- Restoring to ~/.zshrc";
+ZSHRC_ORIG=~/.zshrc.pre-oh-my-zsh
+if [ -e "$ZSHRC_ORIG" ]; then
+ echo "Found $ZSHRC_ORIG -- Restoring to ~/.zshrc"
- if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then
- ZSHRC_SAVE=".zshrc.omz-uninstalled-$(date +%Y%m%d%H%M%S)";
- echo "Found ~/.zshrc -- Renaming to ~/${ZSHRC_SAVE}";
- mv ~/.zshrc ~/"${ZSHRC_SAVE}";
+ if [ -e ~/.zshrc ]; then
+ ZSHRC_SAVE=~/.zshrc.omz-uninstalled-$(date +%Y-%m-%d_%H-%M-%S)
+ echo "Found ~/.zshrc -- Renaming to ${ZSHRC_SAVE}"
+ mv ~/.zshrc "${ZSHRC_SAVE}"
fi
- mv ~/.zshrc.pre-oh-my-zsh ~/.zshrc;
+ mv "$ZSHRC_ORIG" ~/.zshrc
echo "Your original zsh config was restored. Please restart your session."
else