Browse code

fixing #812: adding plugins w/o plugin.zsh file to fpath.

Arbo von Monkiewitsch authored on 16/01/2012 at 17:21:27
Showing 1 changed files
... ...
@@ -19,13 +19,19 @@ if [[ -z "$ZSH_CUSTOM" ]]; then
19 19
     ZSH_CUSTOM="$ZSH/custom"
20 20
 fi
21 21
 
22
+
23
+is_plugin() {
24
+  local base_dir=$1
25
+  local name=$2
26
+  test -f $base_dir/plugins/$name/$name.plugin.zsh \
27
+    || test -f $base_dir/plugins/$name/_$name
28
+}
22 29
 # Add all defined plugins to fpath. This must be done
23 30
 # before running compinit.
24
-plugin=${plugin:=()}
25 31
 for plugin ($plugins); do
26
-  if [ -f $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh ]; then
32
+  if is_plugin $ZSH_CUSTOM $plugin; then
27 33
     fpath=($ZSH_CUSTOM/plugins/$plugin $fpath)
28
-  elif [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then
34
+  elif is_plugin $ZSH $plugin; then
29 35
     fpath=($ZSH/plugins/$plugin $fpath)
30 36
   fi
31 37
 done