Initialize hook only if it's a `pwd` hook

This commit is contained in:
mataha 2023-06-17 02:12:29 +02:00
parent 435a62266a
commit 3883fcd487
1 changed files with 1 additions and 1 deletions

View File

@ -6,7 +6,7 @@
{%- if echo -%}
{%- call batch::indent(tabs) %} ^&^& {%~ call pwd(tabs + 1) -%}^
{%- endif -%}
{%- if hook != InitHook::None -%}
{%- if hook == InitHook::Pwd -%}
{%- call batch::indent(tabs) %} ^&^& for /f "delims=" %$p%a in ('"%__builtin_pwd%"') do @if /i not "%$p%~dpa"=="%$p%~fa" (^
{%- call batch::indent(tabs) %} zoxide add -- "%$p%~fa"^
{%- call batch::indent(tabs) %} ) else (^