Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions templates/bash.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,28 @@
#

# 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
if \command -v cygpath >/dev/null
then
function __zoxide_pwd() {
\command cygpath -w "$({{ pwd }})"
}
else
function __zoxide_pwd() {
{{ pwd }}
}
fi
{%- else %}
\builtin pwd -L
{%- endif %}
function __zoxide_pwd() {
{{ pwd }}
}
{%- endif %}

# cd + custom logic based on the value of _ZO_ECHO.
function __zoxide_cd() {
Expand Down
25 changes: 19 additions & 6 deletions templates/posix.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Loading