Support symlinks on Windows (#1149)
This commit is contained in:
parent
9cdc6aa374
commit
d7458b756e
10
CHANGELOG.md
10
CHANGELOG.md
|
|
@ -7,6 +7,16 @@ All notable changes to this project will be documented in this file.
|
|||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## Unreleased
|
||||
|
||||
### Added
|
||||
|
||||
- POSIX: support for non-Cygwin Windows environments (e.g. Busybox).
|
||||
|
||||
### Fixed
|
||||
|
||||
- Bash/Fish/POSIX/Zsh: resolve symlinks on Windows.
|
||||
|
||||
## [0.9.9] - 2026-01-31
|
||||
|
||||
### Added
|
||||
|
|
|
|||
|
|
@ -9,12 +9,16 @@
|
|||
|
||||
# pwd based on the value of _ZO_RESOLVE_SYMLINKS.
|
||||
function __zoxide_pwd() {
|
||||
{%- let pwd -%}
|
||||
{%- if resolve_symlinks -%}
|
||||
{%- let pwd = "\\builtin pwd -P" -%}
|
||||
{%- else -%}
|
||||
{%- let pwd = "\\builtin pwd -L" -%}
|
||||
{%- endif -%}
|
||||
{%- if cfg!(windows) %}
|
||||
\command cygpath -w "$(\builtin pwd -P)"
|
||||
{%- else if resolve_symlinks %}
|
||||
\builtin pwd -P
|
||||
\command cygpath -w "{{ pwd }}"
|
||||
{%- else %}
|
||||
\builtin pwd -L
|
||||
{{ pwd }}
|
||||
{%- endif %}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,12 +7,16 @@
|
|||
|
||||
# pwd based on the value of _ZO_RESOLVE_SYMLINKS.
|
||||
function __zoxide_pwd
|
||||
{%- let pwd -%}
|
||||
{%- if resolve_symlinks -%}
|
||||
{%- let pwd = "builtin pwd -P" -%}
|
||||
{%- else -%}
|
||||
{%- let pwd = "builtin pwd -L" -%}
|
||||
{%- endif -%}
|
||||
{%- if cfg!(windows) %}
|
||||
command cygpath -w (builtin pwd -P)
|
||||
{%- else if resolve_symlinks %}
|
||||
builtin pwd -P
|
||||
command cygpath -w ({{ pwd }})
|
||||
{%- else %}
|
||||
builtin pwd -L
|
||||
{{ pwd }}
|
||||
{%- endif %}
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -8,15 +8,28 @@
|
|||
#
|
||||
|
||||
# pwd based on the value of _ZO_RESOLVE_SYMLINKS.
|
||||
__zoxide_pwd() {
|
||||
{%- let pwd -%}
|
||||
{%- if resolve_symlinks -%}
|
||||
{%- let pwd = "\\command pwd -P" -%}
|
||||
{%- else -%}
|
||||
{%- let pwd = "\\command pwd -L" -%}
|
||||
{%- endif -%}
|
||||
{%- if cfg!(windows) %}
|
||||
\command cygpath -w "$(\command pwd -P)"
|
||||
{%- else if resolve_symlinks %}
|
||||
\command pwd -P
|
||||
if \command -v cygpath >/dev/null
|
||||
then
|
||||
__zoxide_pwd() {
|
||||
\command cygpath -w "$({{ pwd }})"
|
||||
}
|
||||
else
|
||||
__zoxide_pwd() {
|
||||
{{ pwd }}
|
||||
}
|
||||
fi
|
||||
{%- else %}
|
||||
\command pwd -L
|
||||
{%- endif %}
|
||||
__zoxide_pwd() {
|
||||
{{ pwd }}
|
||||
}
|
||||
{%- endif %}
|
||||
|
||||
# cd + custom logic based on the value of _ZO_ECHO.
|
||||
__zoxide_cd() {
|
||||
|
|
|
|||
|
|
@ -9,12 +9,16 @@
|
|||
|
||||
# pwd based on the value of _ZO_RESOLVE_SYMLINKS.
|
||||
function __zoxide_pwd() {
|
||||
{%- let pwd -%}
|
||||
{%- if resolve_symlinks -%}
|
||||
{%- let pwd = "\\builtin pwd -P" -%}
|
||||
{%- else -%}
|
||||
{%- let pwd = "\\builtin pwd -L" -%}
|
||||
{%- endif -%}
|
||||
{%- if cfg!(windows) %}
|
||||
\command cygpath -w "$(\builtin pwd -P)"
|
||||
{%- else if resolve_symlinks %}
|
||||
\builtin pwd -P
|
||||
\command cygpath -w "{{ pwd }}"
|
||||
{%- else %}
|
||||
\builtin pwd -L
|
||||
{{ pwd }}
|
||||
{%- endif %}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue