Nushell: handle symlinked directories
This commit is contained in:
parent
1f484a4e34
commit
670bdf21b9
|
|
@ -1,4 +1,4 @@
|
||||||
name: Continuous Deployment
|
name: cd
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
- Bash/Zsh: fix `z` failing on Cygwin/MSYS2 due to `cygpath` being passed a bad string.
|
- Bash/Zsh: fix `z` failing on Cygwin/MSYS2 due to `cygpath` being passed a bad string.
|
||||||
|
- Nushell: `z` now handles relative paths through symlinked directories.
|
||||||
|
|
||||||
## [0.10.0] - 2026-07-04
|
## [0.10.0] - 2026-07-04
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,15 +57,14 @@ export-env {
|
||||||
|
|
||||||
# Jump to a directory using only keywords.
|
# Jump to a directory using only keywords.
|
||||||
export def --env --wrapped __zoxide_z [...rest: directory] {
|
export def --env --wrapped __zoxide_z [...rest: directory] {
|
||||||
let path = match $rest {
|
match $rest {
|
||||||
[] => {'~'},
|
[] => { cd ~ },
|
||||||
[ '-' ] => {'-'},
|
[ '-' ] => { cd - },
|
||||||
[ $arg ] if ($arg | path expand | path type) == 'dir' => {$arg}
|
[ $arg ] if (try { cd $arg; true } catch { false }) => {},
|
||||||
_ => {
|
_ => {
|
||||||
^zoxide query --exclude $env.PWD -- ...$rest | str trim -r -c "\n"
|
cd (^zoxide query --exclude $env.PWD -- ...$rest | str trim -r -c "\n")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cd $path
|
|
||||||
{%- if echo %}
|
{%- if echo %}
|
||||||
echo $env.PWD
|
echo $env.PWD
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue