Fix CI
This commit is contained in:
parent
7c93441b56
commit
a776abda81
|
|
@ -13,7 +13,7 @@ function __zoxide_pwd() {
|
||||||
\builtin pwd -P
|
\builtin pwd -P
|
||||||
{%- else %}
|
{%- else %}
|
||||||
\builtin pwd -L
|
\builtin pwd -L
|
||||||
{%- endif %} || \builtin true
|
{%- endif %}
|
||||||
}
|
}
|
||||||
|
|
||||||
# cd + custom logic based on the value of _ZO_ECHO.
|
# cd + custom logic based on the value of _ZO_ECHO.
|
||||||
|
|
@ -34,6 +34,7 @@ function __zoxide_cd() {
|
||||||
{%- if hook == InitHook::Prompt %}
|
{%- if hook == InitHook::Prompt %}
|
||||||
function __zoxide_hook() {
|
function __zoxide_hook() {
|
||||||
\builtin local -r retval="$?"
|
\builtin local -r retval="$?"
|
||||||
|
# shellcheck disable=SC2312
|
||||||
\command zoxide add -- "$(__zoxide_pwd)"
|
\command zoxide add -- "$(__zoxide_pwd)"
|
||||||
return "${retval}"
|
return "${retval}"
|
||||||
}
|
}
|
||||||
|
|
@ -80,6 +81,7 @@ function __zoxide_z() {
|
||||||
__zoxide_cd "{{ "${result:${#__zoxide_z_prefix}}" }}"
|
__zoxide_cd "{{ "${result:${#__zoxide_z_prefix}}" }}"
|
||||||
else
|
else
|
||||||
\builtin local result
|
\builtin local result
|
||||||
|
# shellcheck disable=SC2312
|
||||||
result="$(\command zoxide query --exclude "$(__zoxide_pwd)" -- "$@")" &&
|
result="$(\command zoxide query --exclude "$(__zoxide_pwd)" -- "$@")" &&
|
||||||
__zoxide_cd "${result}"
|
__zoxide_cd "${result}"
|
||||||
fi
|
fi
|
||||||
|
|
@ -129,6 +131,7 @@ if [[ ${BASH_VERSINFO[0]:-0} -eq 4 && ${BASH_VERSINFO[1]:-0} -ge 4 || ${BASH_VER
|
||||||
# If there is a space after the last word, use interactive selection.
|
# If there is a space after the last word, use interactive selection.
|
||||||
elif [[ -z ${COMP_WORDS[-1]} ]]; then
|
elif [[ -z ${COMP_WORDS[-1]} ]]; then
|
||||||
\builtin local result
|
\builtin local result
|
||||||
|
# shellcheck disable=SC2312
|
||||||
result="$(\command zoxide query --exclude "$(__zoxide_pwd)" -i -- "{{ "${COMP_WORDS[@]:1:${#COMP_WORDS[@]}-2}" }}")" &&
|
result="$(\command zoxide query --exclude "$(__zoxide_pwd)" -i -- "{{ "${COMP_WORDS[@]:1:${#COMP_WORDS[@]}-2}" }}")" &&
|
||||||
COMPREPLY=("${__zoxide_z_prefix}${result@Q}")
|
COMPREPLY=("${__zoxide_z_prefix}${result@Q}")
|
||||||
\builtin printf '\e[5n'
|
\builtin printf '\e[5n'
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ function __zoxide_pwd() {
|
||||||
\builtin pwd -P
|
\builtin pwd -P
|
||||||
{%- else %}
|
{%- else %}
|
||||||
\builtin pwd -L
|
\builtin pwd -L
|
||||||
{%- endif %} || \builtin true
|
{%- endif %}
|
||||||
}
|
}
|
||||||
|
|
||||||
# cd + custom logic based on the value of _ZO_ECHO.
|
# cd + custom logic based on the value of _ZO_ECHO.
|
||||||
|
|
@ -32,6 +32,7 @@ function __zoxide_cd() {
|
||||||
{% else -%}
|
{% else -%}
|
||||||
# Hook to add new entries to the database.
|
# Hook to add new entries to the database.
|
||||||
function __zoxide_hook() {
|
function __zoxide_hook() {
|
||||||
|
# shellcheck disable=SC2312
|
||||||
\command zoxide add -- "$(__zoxide_pwd)"
|
\command zoxide add -- "$(__zoxide_pwd)"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -74,6 +75,7 @@ function __zoxide_z() {
|
||||||
__zoxide_cd "{{ "${result:${#__zoxide_z_prefix}}" }}"
|
__zoxide_cd "{{ "${result:${#__zoxide_z_prefix}}" }}"
|
||||||
else
|
else
|
||||||
\builtin local result
|
\builtin local result
|
||||||
|
# shellcheck disable=SC2312
|
||||||
result="$(\command zoxide query --exclude "$(__zoxide_pwd)" -- "$@")" &&
|
result="$(\command zoxide query --exclude "$(__zoxide_pwd)" -- "$@")" &&
|
||||||
__zoxide_cd "${result}"
|
__zoxide_cd "${result}"
|
||||||
fi
|
fi
|
||||||
|
|
@ -112,7 +114,7 @@ if [[ -o zle ]]; then
|
||||||
_files -/
|
_files -/
|
||||||
elif [[ "${words[-1]}" == '' ]]; then
|
elif [[ "${words[-1]}" == '' ]]; then
|
||||||
\builtin local result
|
\builtin local result
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086,SC2312
|
||||||
if result="$(\command zoxide query --exclude "$(__zoxide_pwd)" -i -- ${words[2,-1]})"; then
|
if result="$(\command zoxide query --exclude "$(__zoxide_pwd)" -i -- ${words[2,-1]})"; then
|
||||||
__zoxide_result="${result}"
|
__zoxide_result="${result}"
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue