shell/zsh: accomodate macos + nonstandard paths for arch

This commit is contained in:
Henrik Lissner 2017-12-28 00:50:52 -05:00
parent abfe8212ab
commit 155046a450
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -3,9 +3,12 @@ source ${0:A:h}/../../deploy
source .zshenv source .zshenv
install() { install() {
local zshenv=/etc/zshenv
case $(_os) in case $(_os) in
macos) brew install zsh fasd ;; macos) brew install zsh fasd ;;
arch) sudo pacman --needed --noconfirm -S zsh fasd ;; arch) sudo pacman --needed --noconfirm -S zsh fasd
zshenv=/etc/zsh/zshenv
;;
debian) sudo add-apt-repository ppa:aacebedo/fasd debian) sudo add-apt-repository ppa:aacebedo/fasd
sudo apt-get update && sudo apt-get install -y zsh fasd sudo apt-get update && sudo apt-get install -y zsh fasd
;; ;;
@ -15,7 +18,7 @@ install() {
local zsh="$(which zsh)" local zsh="$(which zsh)"
grep $zsh /etc/shells &>/dev/null || sudo tee -a /etc/shells <<<$zsh grep $zsh /etc/shells &>/dev/null || sudo tee -a /etc/shells <<<$zsh
sudo tee /etc/zsh/zshenv <<<"export ZDOTDIR='$ZDOTDIR'" sudo tee $zshenv <<<"export ZDOTDIR='$ZDOTDIR'"
} }
update() { update() {
@ -29,10 +32,12 @@ update() {
link() { link() {
mklink .zsh* $ZDOTDIR/ mklink .zsh* $ZDOTDIR/
mklink functions $ZDOTDIR/ mklink functions $ZDOTDIR/
[[ $(_os) == macos ]] && mklink .zshenv ~/.zshenv
} }
clean() { clean() {
rm -rfv $ZDOTDIR rm -rfv $ZDOTDIR
[[ $(_os) == macos ]] && rm -f ~/.zshenv
} }
init "$@" init "$@"