From 6b71292dd1924439ab6916c217dfd511a8e99563 Mon Sep 17 00:00:00 2001 From: Kaiiiiiiiii <2761362118@qq.com> Date: Tue, 3 Feb 2026 13:54:49 +0800 Subject: [PATCH] style: align bash guard with shfmt --- src/shell.rs | 2 +- templates/bash.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shell.rs b/src/shell.rs index f3d5edd..38f0388 100644 --- a/src/shell.rs +++ b/src/shell.rs @@ -74,7 +74,7 @@ mod tests { ) { let opts = Opts { cmd, hook, echo, resolve_symlinks }; let source = Bash(&opts).render().unwrap(); - assert!(source.contains("[[ -n \"${__zoxide_result}\" ]] || return")); + assert!(source.contains("[[ -n ${__zoxide_result} ]] || return")); } #[apply(opts)] diff --git a/templates/bash.txt b/templates/bash.txt index 6b82949..ef1ff87 100644 --- a/templates/bash.txt +++ b/templates/bash.txt @@ -179,7 +179,7 @@ if [[ ${BASH_VERSINFO[0]:-0} -eq 4 && ${BASH_VERSINFO[1]:-0} -ge 4 || ${BASH_VER elif [[ -z ${COMP_WORDS[-1]} ]]; then # shellcheck disable=SC2312 __zoxide_result="$(\command zoxide query --exclude "$(__zoxide_pwd)" --interactive -- "{{ "${COMP_WORDS[@]:1:${#COMP_WORDS[@]}-2}" }}")" || return - [[ -n "${__zoxide_result}" ]] || return + [[ -n ${__zoxide_result} ]] || return # In case the terminal does not respond to \e[5n or another # mechanism steals the response, it is still worth completing