2017-12-05 22:39:10 -08:00
|
|
|
#!/usr/bin/env zsh
|
|
|
|
source ${0:A:h}/../../deploy
|
|
|
|
source .zshenv
|
|
|
|
|
|
|
|
install() {
|
2018-02-28 21:13:47 -08:00
|
|
|
local zshenv=/etc/zsh/zshenv
|
2017-12-05 22:39:10 -08:00
|
|
|
case $(_os) in
|
2018-03-23 12:30:15 -07:00
|
|
|
macos) brew install zsh fasd fd
|
2018-02-28 21:13:47 -08:00
|
|
|
zshenv=/etc/zshenv
|
|
|
|
;;
|
2018-03-23 12:30:15 -07:00
|
|
|
arch) sudo pacman --needed --noconfirm -S zsh fasd fd
|
2017-12-27 21:50:52 -08:00
|
|
|
;;
|
2017-12-05 22:39:10 -08:00
|
|
|
debian) sudo add-apt-repository ppa:aacebedo/fasd
|
2018-03-23 12:30:15 -07:00
|
|
|
sudo apt-get update && sudo apt-get install -y zsh fasd fd
|
2017-12-05 22:39:10 -08:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
[[ $SHELL == */zsh ]] || chsh -s $(which zsh) $(whoami)
|
|
|
|
|
|
|
|
local zsh="$(which zsh)"
|
|
|
|
grep $zsh /etc/shells &>/dev/null || sudo tee -a /etc/shells <<<$zsh
|
2018-02-21 15:26:21 -08:00
|
|
|
sudo tee $zshenv <<<"export ZDOTDIR=\"${ZDOTDIR/$HOME/\$HOME}\""
|
2017-12-05 22:39:10 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
update() {
|
2017-12-06 10:56:31 -08:00
|
|
|
if [[ -e $ZGEN_SOURCE/zgen.zsh ]]; then
|
|
|
|
source $ZGEN_SOURCE/zgen.zsh
|
2017-12-05 22:39:10 -08:00
|
|
|
zgen selfupdate
|
|
|
|
zgen update
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
link() {
|
|
|
|
mklink .zsh* $ZDOTDIR/
|
|
|
|
mklink functions $ZDOTDIR/
|
2017-12-27 21:50:52 -08:00
|
|
|
[[ $(_os) == macos ]] && mklink .zshenv ~/.zshenv
|
2017-12-05 22:39:10 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
clean() {
|
|
|
|
rm -rfv $ZDOTDIR
|
2017-12-27 21:50:52 -08:00
|
|
|
[[ $(_os) == macos ]] && rm -f ~/.zshenv
|
2017-12-05 22:39:10 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
init "$@"
|