2016-10-19 07:56:37 -07:00
|
|
|
#!/bin/bash
|
|
|
|
|
2016-12-06 09:40:17 -08:00
|
|
|
if [[ "$SHELL" != *zsh ]]; then
|
2016-10-19 07:56:37 -07:00
|
|
|
case "$OSTYPE" in
|
|
|
|
darwin*)
|
|
|
|
brew install zsh
|
|
|
|
|
|
|
|
# Add homebrewed zsh to /etc/shells
|
2016-12-06 09:40:17 -08:00
|
|
|
if ! grep '/usr/local/bin/zsh' /etc/shells >/dev/null; then
|
|
|
|
sudo tee -a /etc/shells <<< "/usr/local/bin/zsh"
|
2016-10-19 07:56:37 -07:00
|
|
|
fi
|
|
|
|
;;
|
|
|
|
linux*)
|
2016-12-16 15:36:59 -08:00
|
|
|
if [[ -f /etc/arch-release ]]; then
|
2016-12-06 09:40:17 -08:00
|
|
|
sudo pacman --needed --noconfirm -S zsh
|
2016-12-16 15:36:59 -08:00
|
|
|
elif [[ -f /etc/debian_version ]]; then
|
2016-12-06 09:40:17 -08:00
|
|
|
sudo apt-get install -y zsh
|
2016-10-19 07:56:37 -07:00
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
chsh -s $(which zsh)
|
|
|
|
fi
|