Fix double cd error

This commit is contained in:
Ajeet D'Souza 2020-12-13 04:15:04 +05:30
parent 18121e07f9
commit 85f230bd8f
1 changed files with 1 additions and 3 deletions

View File

@ -59,9 +59,7 @@ function __zoxide_z() {
echo "zoxide: \\$OLDPWD is not set"
return 1
fi
elif [ "$#" -eq 1 ] && cd "$1" &>{{ Opts::DEVNULL }}; then
__zoxide_cd "$1"
else
elif ! { [ "$#" -eq 1 ] && __zoxide_cd "$1" &>{{ Opts::DEVNULL }}; }; then
local __zoxide_result
__zoxide_result="$(zoxide query -- "$@")" && __zoxide_cd "$__zoxide_result"
fi