Support nushell removal of spread operator

Currently there is a warning that it will be removed starting from 0.90.1. Fixes #661
This commit is contained in:
Alexis Praga 2024-02-10 14:55:51 +01:00
parent 3022cf3686
commit 01e945cacb
1 changed files with 2 additions and 2 deletions

View File

@ -44,7 +44,7 @@ def --env __zoxide_z [...rest:string] {
let path = if (($rest | length) <= 1) and ($arg0 == '-' or ($arg0 | path expand | path type) == dir) { let path = if (($rest | length) <= 1) and ($arg0 == '-' or ($arg0 | path expand | path type) == dir) {
$arg0 $arg0
} else { } else {
(zoxide query --exclude $env.PWD -- $rest | str trim -r -c "\n") (zoxide query --exclude $env.PWD -- ...$rest | str trim -r -c "\n")
} }
cd $path cd $path
{%- if echo %} {%- if echo %}
@ -54,7 +54,7 @@ def --env __zoxide_z [...rest:string] {
# Jump to a directory using interactive search. # Jump to a directory using interactive search.
def --env __zoxide_zi [...rest:string] { def --env __zoxide_zi [...rest:string] {
cd $'(zoxide query --interactive -- $rest | str trim -r -c "\n")' cd $'(zoxide query --interactive -- ...$rest | str trim -r -c "\n")'
{%- if echo %} {%- if echo %}
echo $env.PWD echo $env.PWD
{%- endif %} {%- endif %}