From 1a4c4933cadd67f6e5717db3db35f0b6d447604b Mon Sep 17 00:00:00 2001 From: dedebenui <41047847+dedebenui@users.noreply.github.com> Date: Wed, 29 May 2024 09:45:56 +0200 Subject: [PATCH] fixed nushell init for new `path type` behavior (#830) --- templates/nushell.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/nushell.txt b/templates/nushell.txt index a934364..90d5cba 100644 --- a/templates/nushell.txt +++ b/templates/nushell.txt @@ -41,7 +41,8 @@ if (not ($env | default false __zoxide_hooked | get __zoxide_hooked)) { # Jump to a directory using only keywords. def --env --wrapped __zoxide_z [...rest:string] { let arg0 = ($rest | append '~').0 - let path = if (($rest | length) <= 1) and ($arg0 == '-' or ($arg0 | path expand | path type) == dir) { + let arg0_is_dir = (try {$arg0 | path expand | path type}) == 'dir' + let path = if (($rest | length) <= 1) and ($arg0 == '-' or $arg0_is_dir) { $arg0 } else { (zoxide query --exclude $env.PWD -- ...$rest | str trim -r -c "\n")