Add check for precmd_function before adding to it

This commit is contained in:
Ajeet D'Souza 2020-03-08 08:15:02 +05:30
parent 32ed84c27e
commit c88210ccce

View File

@ -4,7 +4,9 @@ _zoxide_precmd() {
zoxide add
}
precmd_functions+=_zoxide_precmd
[[ -n "${precmd_functions[(r)_zoxide_precmd]}" ]] || {
precmd_functions+=_zoxide_precmd
}
z() {
if [ $# -ne 0 ]; then