This commit is contained in:
Peppr 2026-05-21 20:19:00 -04:00 committed by GitHub
commit f1c6e61891
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 8 additions and 0 deletions

View File

@ -111,6 +111,8 @@ function __zoxide_z() {
__zoxide_cd ~
elif [[ $# -eq 1 && $1 == '-' ]]; then
__zoxide_cd "${OLDPWD}"
elif [[ $# -eq 1 && ($1 == '.' || $1 == '..') ]]; then
__zoxide_cd "$1"
elif [[ $# -eq 1 && -d $1 ]]; then
__zoxide_cd "$1"
elif [[ $# -eq 2 && $1 == '--' ]]; then

View File

@ -79,6 +79,8 @@ function __zoxide_z
__zoxide_cd $HOME
else if test "$argv" = -
__zoxide_cd -
else if test $argc -eq 1 -a \( "$argv[1]" = '.' -o "$argv[1]" = '..' \)
__zoxide_cd $argv[1]
else if test $argc -eq 1 -a -d $argv[1]
__zoxide_cd $argv[1]
else if test $argc -eq 2 -a $argv[1] = --

View File

@ -105,6 +105,8 @@ __zoxide_z() {
\command printf 'zoxide: $OLDPWD is not set'
return 1
fi
elif [ "$#" -eq 1 ] && { [ "$1" = '.' ] || [ "$1" = '..' ]; }; then
__zoxide_cd "$1"
elif [ "$#" -eq 1 ] && [ -d "$1" ]; then
__zoxide_cd "$1"
else

View File

@ -89,6 +89,8 @@ function __zoxide_z() {
__zoxide_doctor
if [[ "$#" -eq 0 ]]; then
__zoxide_cd ~
elif [[ "$#" -eq 1 && ($1 == '.' || $1 == '..') ]]; then
__zoxide_cd "$1"
elif [[ "$#" -eq 1 ]] && { [[ -d "$1" ]] || [[ "$1" = '-' ]] || [[ "$1" =~ ^[-+][0-9]+$ ]]; }; then
__zoxide_cd "$1"
elif [[ "$#" -eq 2 ]] && [[ "$1" = "--" ]]; then