From b84ae117e28c8464f652fcbd97432b587f4aca33 Mon Sep 17 00:00:00 2001 From: Gregory Hugaerts Date: Thu, 21 Feb 2013 23:47:42 +0100 Subject: [PATCH] add check for pmodload, fallback to sourcing if it is not defined --- antigen.zsh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/antigen.zsh b/antigen.zsh index eb2ae56..7356db9 100644 --- a/antigen.zsh +++ b/antigen.zsh @@ -273,9 +273,15 @@ antigen-revert () { source "$location/$script_loc" elif [[ -f $location/init.zsh ]]; then - # If we have a `init.zsh`, pmodload the module. - local module="$(echo $loc|sed -e 's/^modules\///')" #remove modules/ from loc to find module name - pmodload "$module" + # If we have a `init.zsh` + if (( $+functions[pmodload] )); then + # if pmodload is defined pmodload the module. + local module="$(echo $loc|sed -e 's/^modules\///')" #remove modules/ from loc to find module name + pmodload "$module" + else + # otherwise source it. + source "$location/init.zsh" + fi elif ls "$location" | grep -qm1 '\.zsh$'; then # If there is no `*.plugin.zsh` file, source *all* the `*.zsh` -- 2.0.0