shell/zsh: refactor install script

This commit is contained in:
Henrik Lissner 2016-12-06 12:40:17 -05:00
parent b32171f6be
commit ac7b7dd9b0

View file

@ -1,22 +1,20 @@
#!/bin/bash
if [[ "$SHELL" != *zsh ]]
then
if [[ "$SHELL" != *zsh ]]; then
case "$OSTYPE" in
darwin*)
brew install zsh
# Add homebrewed zsh to /etc/shells
if ! grep '/usr/local/bin/zsh' /etc/shells >/dev/null;
then
sudo bash -c "echo '/usr/local/bin/zsh' >> /etc/shells"
if ! grep '/usr/local/bin/zsh' /etc/shells >/dev/null; then
sudo tee -a /etc/shells <<< "/usr/local/bin/zsh"
fi
;;
linux*)
if [ -f /etc/arch-release ]; then
sudo pacman --noconfirm -S zsh
sudo pacman --needed --noconfirm -S zsh
elif [ -f /etc/debian_version ]; then
sudo apt-get install zsh
sudo apt-get install -y zsh
fi
;;
esac