Remove uses of builtin from POSIX

This commit is contained in:
Ajeet D'Souza 2025-11-18 20:10:30 +05:30
parent ecf72c9cfd
commit a9c31f59df
1 changed files with 3 additions and 3 deletions

View File

@ -10,7 +10,7 @@
# pwd based on the value of _ZO_RESOLVE_SYMLINKS. # pwd based on the value of _ZO_RESOLVE_SYMLINKS.
__zoxide_pwd() { __zoxide_pwd() {
{%- if cfg!(windows) %} {%- if cfg!(windows) %}
\command cygpath -w "$(\builtin pwd -P)" \command cygpath -w "$(\command pwd -P)"
{%- else if resolve_symlinks %} {%- else if resolve_symlinks %}
\command pwd -P \command pwd -P
{%- else %} {%- else %}
@ -35,7 +35,7 @@ __zoxide_cd() {
{%- when InitHook::Prompt -%} {%- when InitHook::Prompt -%}
# Hook to add new entries to the database. # Hook to add new entries to the database.
__zoxide_hook() { __zoxide_hook() {
\command zoxide add -- "$(__zoxide_pwd || \builtin true)" \command zoxide add -- "$(__zoxide_pwd || \command true)"
} }
# Initialize hook. # Initialize hook.
@ -95,7 +95,7 @@ __zoxide_z() {
elif [ "$#" -eq 1 ] && [ -d "$1" ]; then elif [ "$#" -eq 1 ] && [ -d "$1" ]; then
__zoxide_cd "$1" __zoxide_cd "$1"
else else
__zoxide_result="$(\command zoxide query --exclude "$(__zoxide_pwd || \builtin true)" -- "$@")" && __zoxide_result="$(\command zoxide query --exclude "$(__zoxide_pwd || \command true)" -- "$@")" &&
__zoxide_cd "${__zoxide_result}" __zoxide_cd "${__zoxide_result}"
fi fi
} }