From 00db89d00d4b2738f39dc9f87ba0d17d3b31eb59 Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Sat, 10 Feb 2024 17:47:41 +0100 Subject: [PATCH] Only unfunction axzsh_plugin_init() when it still exists The axzsh_handle_stage() can be called recursively, therefore axzsh_plugin_init() was probably already unfunction'ed. --- ax.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ax.zsh b/ax.zsh index f210039..a0fb5d8 100644 --- a/ax.zsh +++ b/ax.zsh @@ -57,7 +57,7 @@ function axzsh_handle_stage { [[ -n "$AXZSH_DEBUG" ]] \ && echo " - Reading cache file \"$cache_file\" ..." source "$cache_file" - unfunction axzsh_plugin_init + (( $+functions[axzsh_plugin_init] )) && unfunction axzsh_plugin_init else # No cache file available. local new_cache_file="$cache_file.NEW" -- 2.39.2