Skip to content

Commit

Permalink
Update nushell template to use rest operator where needed
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuruuh committed Jan 10, 2024
1 parent 3022cf3 commit 1809333
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions templates/nushell.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
$arg0
} 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
{%- if echo %}
Expand All @@ -54,7 +54,7 @@ def --env __zoxide_z [...rest:string] {

# Jump to a directory using interactive search.
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 %}
echo $env.PWD
{%- endif %}
Expand Down

0 comments on commit 1809333

Please sign in to comment.