From 3883fcd4879806f52aeb6db5974468fb958d28b4 Mon Sep 17 00:00:00 2001 From: mataha Date: Sat, 17 Jun 2023 02:12:29 +0200 Subject: [PATCH] Initialize hook only if it's a `pwd` hook --- templates/cmd.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/cmd.txt b/templates/cmd.txt index 9a07fc9..f033226 100644 --- a/templates/cmd.txt +++ b/templates/cmd.txt @@ -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 (^