shell/zsh: refactor install script
This commit is contained in:
parent
b32171f6be
commit
ac7b7dd9b0
|
@ -1,22 +1,20 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if [[ "$SHELL" != *zsh ]]
|
if [[ "$SHELL" != *zsh ]]; then
|
||||||
then
|
|
||||||
case "$OSTYPE" in
|
case "$OSTYPE" in
|
||||||
darwin*)
|
darwin*)
|
||||||
brew install zsh
|
brew install zsh
|
||||||
|
|
||||||
# Add homebrewed zsh to /etc/shells
|
# Add homebrewed zsh to /etc/shells
|
||||||
if ! grep '/usr/local/bin/zsh' /etc/shells >/dev/null;
|
if ! grep '/usr/local/bin/zsh' /etc/shells >/dev/null; then
|
||||||
then
|
sudo tee -a /etc/shells <<< "/usr/local/bin/zsh"
|
||||||
sudo bash -c "echo '/usr/local/bin/zsh' >> /etc/shells"
|
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
linux*)
|
linux*)
|
||||||
if [ -f /etc/arch-release ]; then
|
if [ -f /etc/arch-release ]; then
|
||||||
sudo pacman --noconfirm -S zsh
|
sudo pacman --needed --noconfirm -S zsh
|
||||||
elif [ -f /etc/debian_version ]; then
|
elif [ -f /etc/debian_version ]; then
|
||||||
sudo apt-get install zsh
|
sudo apt-get install -y zsh
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Reference in a new issue