Fix hook initialization on Powershell (#280)

This commit is contained in:
Ajeet D'Souza 2021-10-15 08:27:09 +05:30 committed by GitHub
parent c872b96703
commit 095e9d3d6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,7 +34,11 @@ function __zoxide_hook {
} }
# Initialize hook. # Initialize hook.
if (-Not (Get-Command '__zoxide_hook' -ErrorAction SilentlyContinue)) { {# Initialize $__zoxide_hooked if it does not exist. Removing this will cause
# an unset variable error in StrictMode. #}
$__zoxide_hooked = (Get-Variable __zoxide_hooked -ValueOnly -ErrorAction SilentlyContinue)
if ($__zoxide_hooked -ne 1) {
$__zoxide_hooked = 1
{%- match hook %} {%- match hook %}
{%- when InitHook::None %} {%- when InitHook::None %}
{{ not_configured }} {{ not_configured }}