Skip to content

Commit

Permalink
Fixing conflict in install scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
probablynot authored and robbyrussell committed Dec 2, 2012
1 parent d19e01b commit dfbafe6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
3 changes: 1 addition & 2 deletions tools/install.sh
Expand Up @@ -14,8 +14,7 @@ echo "\033[0;34mLooking for an existing zsh config...\033[0m"
if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]
then
echo "\033[0;33mFound ~/.zshrc.\033[0m \033[0;32mBacking up to ~/.zshrc.pre-oh-my-zsh\033[0m";
cp ~/.zshrc ~/.zshrc.pre-oh-my-zsh;
rm ~/.zshrc;
mv ~/.zshrc ~/.zshrc.pre-oh-my-zsh;
fi

echo "\033[0;34mUsing the Oh My Zsh template file and adding it to ~/.zshrc\033[0m"
Expand Down
18 changes: 13 additions & 5 deletions tools/uninstall.sh
Expand Up @@ -4,17 +4,25 @@ then
rm -rf ~/.oh-my-zsh
fi

echo "Looking for an existing zsh config..."
echo "Looking for original zsh config..."
if [ -f ~/.zshrc.pre-oh-my-zsh ] || [ -h ~/.zshrc.pre-oh-my-zsh ]
then
echo "Found ~/.zshrc. Backing up to ~/.zshrc.pre-oh-my-zsh";
rm ~/.zshrc;
cp ~/.zshrc.pre-oh-my-zsh ~/.zshrc;
echo "Found ~/.zshrc.pre-oh-my-zsh -- 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};
fi

mv ~/.zshrc.pre-oh-my-zsh ~/.zshrc;

source ~/.zshrc;
else
echo "Switching back to bash"
chsh -s /bin/bash
source /etc/profile
fi

echo "Thanks for trying out Oh My Zsh. It's been uninstalled."
echo "Thanks for trying out Oh My Zsh. It's been uninstalled."

0 comments on commit dfbafe6

Please sign in to comment.