24 lines
613 B
Bash
Executable file
24 lines
613 B
Bash
Executable file
#!/bin/bash
|
|
|
|
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 tee -a /etc/shells <<< "/usr/local/bin/zsh"
|
|
fi
|
|
;;
|
|
linux*)
|
|
if [[ -f /etc/arch-release ]]; then
|
|
sudo pacman --needed --noconfirm -S zsh
|
|
elif [[ -f /etc/debian_version ]]; then
|
|
sudo apt-get install -y zsh
|
|
fi
|
|
;;
|
|
esac
|
|
|
|
chsh -s $(which zsh)
|
|
fi
|