Add support for multi digits dirstack entry (e.g. +12). (#1080)
Some checks failed
ci / ubuntu-latest (push) Has been cancelled
release / aarch64-apple-darwin (push) Has been cancelled
release / x86_64-apple-darwin (push) Has been cancelled
release / aarch64-unknown-linux-musl (push) Has been cancelled
release / armv7-unknown-linux-musleabihf (push) Has been cancelled
release / i686-unknown-linux-musl (push) Has been cancelled
release / x86_64-unknown-linux-musl (push) Has been cancelled
release / aarch64-linux-android (push) Has been cancelled
release / arm-unknown-linux-musleabihf (push) Has been cancelled
release / aarch64-pc-windows-msvc (push) Has been cancelled
release / x86_64-pc-windows-msvc (push) Has been cancelled

This commit is contained in:
Tony 2025-06-17 17:57:46 +08:00 committed by GitHub
parent db14bdc2ff
commit 6324b4e347
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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