From: Alexander Barton Date: Sat, 10 Feb 2024 16:47:41 +0000 (+0100) Subject: Only unfunction axzsh_plugin_init() when it still exists X-Git-Url: https://arthur.ath.cx/gitweb/?a=commitdiff_plain;h=00db89d00d4b2738f39dc9f87ba0d17d3b31eb59;p=ax-zsh.git 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. --- 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"