helm/install/zsh

44 lines
1.1 KiB
Plaintext
Raw Normal View History

2013-03-22 18:06:04 -07:00
#!/usr/bin/env bash
source ~/.dotfiles/zsh/functions
2013-03-16 21:16:00 -07:00
if [ ! -d ~/.oh-my-zsh ]; then
2013-08-03 08:17:01 -07:00
# Try to install zsh
if ! pkg_install zsh; then
echo_g "==> ZSH: Homebrew is not installed!"
exit 1
fi
2013-03-25 17:31:23 -07:00
2013-03-16 21:16:00 -07:00
# https://github.com/robbyrussell/oh-my-zsh
2013-12-17 17:02:41 -08:00
if [ ! -d ~/.oh-my-zsh ]; then
echo_g "==> ZSH: Installing oh-my-zsh"
git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
fi
2013-03-16 21:16:00 -07:00
# Set new shell
2013-10-18 04:03:28 -07:00
echo_g "==> ZSH: Changing shell"
2013-12-17 17:02:41 -08:00
if is_mac; then
zsh_bin="`brew --prefix`/bin/zsh"
echo $zsh_bin | sudo tee /etc/shells
else
2013-12-17 17:02:41 -08:00
zsh_bin="/usr/bin/zsh"
echo $zsh_bin | sudo tee -a /etc/shells
fi
2013-12-17 17:02:41 -08:00
# Change the shell
chsh -s "$zsh_bin"
2013-03-22 18:07:17 -07:00
else
2013-10-18 04:03:28 -07:00
echo_g "==> ZSH: Updating"
2013-03-22 18:07:17 -07:00
cd ~/.oh-my-zsh
git pull
2013-03-16 21:16:00 -07:00
fi
# Create links
2013-10-18 04:03:28 -07:00
echo_g "==> ZSH: Setting up symlinks"
2013-12-17 17:02:41 -08:00
rm -f ~/.zsh && ln -sf ~/.dotfiles/zsh ~/.zsh
rm -f ~/.zshrc && ln -sf ~/.dotfiles/zshrc ~/.zshrc
rm -f ~/.zshenv && ln -sf ~/.dotfiles/zshenv ~/.zshenv
rm -f ~/.bashrc && ln -sf ~/.dotfiles/bashrc ~/.bashrc
2013-03-16 21:16:00 -07:00
2013-10-18 04:03:28 -07:00
echo_g "==> ZSH: DONE!"