mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-20 03:02:29 +01:00
Save current shell when installing
* Don't change login shell to zsh if already zsh * Restore previous shell instead of bash when uninstalling * Fix bashism in tools/uninstall.sh
This commit is contained in:
parent
ca90021630
commit
4886eea1aa
2 changed files with 20 additions and 8 deletions
|
|
@ -1,5 +1,5 @@
|
|||
echo "Removing ~/.oh-my-zsh"
|
||||
if [[ -d ~/.oh-my-zsh ]]
|
||||
if [ -d ~/.oh-my-zsh ]
|
||||
then
|
||||
rm -rf ~/.oh-my-zsh
|
||||
fi
|
||||
|
|
@ -17,12 +17,17 @@ then
|
|||
fi
|
||||
|
||||
mv ~/.zshrc.pre-oh-my-zsh ~/.zshrc;
|
||||
fi
|
||||
|
||||
source ~/.zshrc;
|
||||
else
|
||||
echo "Switching back to bash"
|
||||
chsh -s /bin/bash
|
||||
source /etc/profile
|
||||
echo "Looking for previous default shell..."
|
||||
if [ -f ~/.pre-oh-my-zsh-shell ] || [ -h ~/.pre-oh-my-zsh-shell ]
|
||||
then
|
||||
PREVSHELL=$(cat ~/.pre-oh-my-zsh-shell)
|
||||
if [ -x "$PREVSHELL" ]
|
||||
then
|
||||
echo "Switching back to $PREVSHELL"
|
||||
chsh -s $PREVSHELL
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Thanks for trying out Oh My Zsh. It's been uninstalled."
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue