fix: handle error for empty zoxide query result
This commit is contained in:
parent
7113ccddea
commit
bc61a463e5
|
|
@ -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 %}
|
||||
|
|
|
|||
Loading…
Reference in New Issue