From a80f20520e9a4ac734830e72dcec2206102e9ccd Mon Sep 17 00:00:00 2001 From: Ajeet D'Souza <98ajeet@gmail.com> Date: Fri, 3 Sep 2021 10:11:42 +0530 Subject: [PATCH] Remove unnecessary echo --- templates/nushell.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/templates/nushell.txt b/templates/nushell.txt index 41e32ae..23642c2 100644 --- a/templates/nushell.txt +++ b/templates/nushell.txt @@ -10,7 +10,7 @@ # Default prompt for Nushell. def __zoxide_prompt [] { let git = $'(do -i {git rev-parse --abbrev-ref HEAD} | str trim)' - let git = (if (echo $git | str length) == 0 { + let git = (if ($git | str length) == 0 { '' } { build-string (char lparen) (ansi cb) $git (ansi reset) (char rparen) @@ -55,17 +55,17 @@ $'zoxide: PWD hooks are not supported on Nushell.(char nl)Use (char sq)zoxide in # Jump to a directory using only keywords. def __zoxide_z [...rest:string] { if (shells | where active == $true | get name) != filesystem { - if (echo $rest | length) > 1 { + if ($rest | length) > 1 { $'zoxide: can only jump directories on filesystem(char nl)' } { - cd (echo $rest) + cd $rest {%- if echo %} pwd {%- endif %} } } { - let arg0 = (echo $rest | append '~' | first 1); - if (echo $rest | length) <= 1 && ($arg0 == '-' || (echo $arg0 | path expand | path exists)) { + let arg0 = ($rest | append '~' | first 1); + if ($rest | length) <= 1 && ($arg0 == '-' || ($arg0 | path expand | path exists)) { cd $arg0 } { cd $'(zoxide query --exclude (pwd) -- $rest | str trim)'