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*)
|
2017-04-24 23:36:25 -07:00
|
|
|
brew install zsh fasd
|
2016-10-19 07:56:37 -07:00
|
|
|
|
|
|
|
# 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
|
2017-05-05 00:53:10 -07:00
|
|
|
|
|
|
|
# Don't mess with my PATH!
|
|
|
|
sudo mv /etc/zprofile /etc/zprofile.disabled
|
2016-10-19 07:56:37 -07:00
|
|
|
;;
|
|
|
|
linux*)
|
2016-12-16 15:36:59 -08:00
|
|
|
if [[ -f /etc/arch-release ]]; then
|
2017-04-24 23:36:25 -07:00
|
|
|
sudo pacman --needed --noconfirm -S zsh fasd
|
2016-12-16 15:36:59 -08:00
|
|
|
elif [[ -f /etc/debian_version ]]; then
|
2017-04-23 21:26:33 -07:00
|
|
|
sudo add-apt-repository ppa:aacebedo/fasd
|
|
|
|
sudo apt-get update
|
2017-04-24 23:36:25 -07:00
|
|
|
sudo apt-get install -y zsh fasd
|
2016-10-19 07:56:37 -07:00
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
chsh -s $(which zsh)
|
|
|
|
fi
|