fix: handle error for empty zoxide query result

This commit is contained in:
marcelarie 2024-10-08 19:32:45 +02:00
parent 7113ccddea
commit bc61a463e5
1 changed files with 5 additions and 1 deletions

View File

@ -45,7 +45,11 @@ def --env --wrapped __zoxide_z [...rest:string] {
let path = if (($rest | length) <= 1) and ($arg0 == '-' or $arg0_is_dir) {
$arg0
} else {
(zoxide query --exclude $env.PWD -- ...$rest | str trim -r -c "\n")
(try {
zoxide query --exclude $env.PWD -- ...$rest | str trim -r -c "\n"
} catch {
""
})
}
cd $path
{%- if echo %}