helm/shell/zsh/install

24 lines
613 B
Plaintext
Raw Normal View History

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*)
if [[ -f /etc/arch-release ]]; then
2016-12-06 09:40:17 -08:00
sudo pacman --needed --noconfirm -S zsh
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