]> arthur.barton.de Git - ax-zsh.git/commitdiff
Fix handling of foreign plugins
authorAlexander Barton <alex@barton.de>
Fri, 6 May 2016 10:39:04 +0000 (12:39 +0200)
committerAlexander Barton <alex@barton.de>
Fri, 6 May 2016 10:39:04 +0000 (12:39 +0200)
And enhance error handling & reporting.

ax.zsh

diff --git a/ax.zsh b/ax.zsh
index e9b8641a28e37900204f75cadb865d1745c50f01..59e172d46197f64a770782a08777d1dbd3e02072 100644 (file)
--- a/ax.zsh
+++ b/ax.zsh
@@ -26,7 +26,10 @@ function axzsh_load_plugin {
        fi
 
        if [[ ! -r "$fname" && "$type" == "zshrc" ]]; then
-               if [[ -r "$dname/$plugin.plugin.zsh" ]]; then
+               if [[ -r "$dname/$plugin.zprofile" || -r "$dname/$plugin.zlogout" ]]; then
+                       # Native AX-ZSH plugin, but for different stage. Skip it!
+                       :
+               elif [[ -r "$dname/$plugin.plugin.zsh" ]]; then
                        # Oh My ZSH plugin
                        type="plugin.zsh"
                        fname="$dname/$plugin.plugin.zsh"
@@ -34,6 +37,8 @@ function axzsh_load_plugin {
                        # Prezto module
                        type="init.zsh"
                        fname="$dname/init.zsh"
+               else
+                       echo "AX-ZSH plugin type of \"$plugin\" unknown, skipped!" >&2
                fi
        fi