Use safer append to hook function arrays (#8406)

Use add-zsh-hook to add functions to hooks. That way they won't be added again
when doing `source ~/.zshrc` multiple times.

Co-authored-by: Marc Cornellà <marc.cornella@live.com>
This commit is contained in:
Jacob Tomaw
2019-11-19 12:47:12 -05:00
committed by Marc Cornellà
parent d4f32e9f3a
commit 1ba0af650a
12 changed files with 29 additions and 23 deletions

View File

@ -23,7 +23,8 @@ _togglePipenvShell() {
fi
fi
}
chpwd_functions+=(_togglePipenvShell)
autoload -U add-zsh-hook
add-zsh-hook chpwd _togglePipenvShell
# Aliases
alias pch="pipenv check"