diff options
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/install.sh | 5 | ||||
-rw-r--r-- | tools/uninstall.sh | 18 | ||||
-rw-r--r-- | tools/upgrade.sh | 7 |
3 files changed, 17 insertions, 13 deletions
diff --git a/tools/install.sh b/tools/install.sh index 6f58db939..a2bd5665a 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -14,15 +14,14 @@ 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" cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m" -echo "export PATH=$PATH" >> ~/.zshrc +echo "export PATH=\$PATH:$PATH" >> ~/.zshrc echo "\033[0;34mTime to change your default shell to zsh!\033[0m" chsh -s `which zsh` diff --git a/tools/uninstall.sh b/tools/uninstall.sh index 8ff583322..41d601576 100644 --- a/tools/uninstall.sh +++ b/tools/uninstall.sh @@ -4,12 +4,20 @@ 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" @@ -17,4 +25,4 @@ else source /etc/profile fi -echo "Thanks for trying out Oh My Zsh. It's been uninstalled."
\ No newline at end of file +echo "Thanks for trying out Oh My Zsh. It's been uninstalled." diff --git a/tools/upgrade.sh b/tools/upgrade.sh index b2a1c06c4..e04fc672f 100644 --- a/tools/upgrade.sh +++ b/tools/upgrade.sh @@ -1,8 +1,6 @@ -current_path=`pwd` printf '\033[0;34m%s\033[0m\n' "Upgrading Oh My Zsh" -cd $ZSH - -if git pull origin master +cd "$ZSH" +if git pull --rebase origin master then printf '\033[0;32m%s\033[0m\n' ' __ __ ' printf '\033[0;32m%s\033[0m\n' ' ____ / /_ ____ ___ __ __ ____ _____/ /_ ' @@ -16,4 +14,3 @@ else printf '\033[0;31m%s\033[0m\n' 'There was an error updating. Try again later?' fi -cd "$current_path"
\ No newline at end of file |