]> arthur.barton.de Git - ax-zsh.git/commitdiff
Only unfunction axzsh_plugin_init() when it still exists
authorAlexander Barton <alex@barton.de>
Sat, 10 Feb 2024 16:47:41 +0000 (17:47 +0100)
committerAlexander Barton <alex@barton.de>
Sat, 10 Feb 2024 16:47:43 +0000 (17:47 +0100)
The axzsh_handle_stage() can be called recursively, therefore
axzsh_plugin_init() was probably already unfunction'ed.

ax.zsh

diff --git a/ax.zsh b/ax.zsh
index f2100399895d245465a58addbaa232e4590ce198..a0fb5d8b66e664e372a081ccfd2289df4d77cf6e 100644 (file)
--- 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"