mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-13 03:01:32 +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
|
|
@ -32,8 +32,15 @@ sed -i -e "/export PATH=/ c\\
|
|||
export PATH=\"$PATH\"
|
||||
" ~/.zshrc
|
||||
|
||||
echo "\033[0;34mTime to change your default shell to zsh!\033[0m"
|
||||
chsh -s `which zsh`
|
||||
[ -x "$(which getent)" ] && CURSHELL=$(getent passwd $LOGNAME | cut -d: -f7)
|
||||
[ -x "$(which dscl)" ] && CURSHELL=$(dscl /Search -read "/Users/$USER" UserShell | awk '{print $2}')
|
||||
|
||||
if [ -n "$CURSHELL" ] && [ "$CURSHELL" != "$(which zsh)" ]; then
|
||||
echo "\033[0;34mSaving your current default shell to ~/.pre-oh-my-zsh-shell\033[0m"
|
||||
[ -n "$CURSHELL" ] && echo $CURSHELL > ~/.pre-oh-my-zsh-shell
|
||||
echo "\033[0;34mTime to change your default shell to zsh!\033[0m"
|
||||
chsh -s `which zsh`
|
||||
fi
|
||||
|
||||
echo "\033[0;32m"' __ __ '"\033[0m"
|
||||
echo "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue