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
This commit is contained in:
WindSoilder 2023-11-14 10:51:58 +08:00 committed by GitHub
parent 073500cbdf
commit 0366eda599
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -39,7 +39,7 @@ if (not ($env | default false __zoxide_hooked | get __zoxide_hooked)) {
# #
# Jump to a directory using only keywords. # 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 arg0 = ($rest | append '~').0
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
@ -53,7 +53,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