shell/zsh: refactor install script
This commit is contained in:
parent
b32171f6be
commit
ac7b7dd9b0
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue