From 0366eda59943c71b889e9f27cc62bce7845c740c Mon Sep 17 00:00:00 2001 From: WindSoilder Date: Tue, 14 Nov 2023 10:51:58 +0800 Subject: [PATCH] Make zoxide compitable with upcoming nushell release nushell will deprecate `def-env` and use `def --env` in the next release(0.87) Currently `def --env` is already available in latest version (0.86) Relative: #630 --- templates/nushell.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/nushell.txt b/templates/nushell.txt index c4894da..fc463f3 100644 --- a/templates/nushell.txt +++ b/templates/nushell.txt @@ -39,7 +39,7 @@ if (not ($env | default false __zoxide_hooked | get __zoxide_hooked)) { # # Jump to a directory using only keywords. -def-env __zoxide_z [...rest:string] { +def --env __zoxide_z [...rest:string] { let arg0 = ($rest | append '~').0 let path = if (($rest | length) <= 1) and ($arg0 == '-' or ($arg0 | path expand | path type) == dir) { $arg0 @@ -53,7 +53,7 @@ def-env __zoxide_z [...rest:string] { } # 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")' {%- if echo %} echo $env.PWD