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) {
|
let path = if (($rest | length) <= 1) and ($arg0 == '-' or $arg0_is_dir) {
|
||||||
$arg0
|
$arg0
|
||||||
} else {
|
} 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
|
cd $path
|
||||||
{%- if echo %}
|
{%- if echo %}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue