diff options
author | Arbo von Monkiewitsch <arbo@soundcloud.com> | 2012-01-16 18:21:27 +0100 |
---|---|---|
committer | Arbo von Monkiewitsch <arbo@soundcloud.com> | 2012-01-16 18:25:14 +0100 |
commit | 4b3429d765f1f14f7dbf2cc451e3047388978bf6 (patch) | |
tree | 8b6b172b342de416890917de32566402d6ac7788 | |
parent | 7a41498b0d4f68c537d494b5f849913361315fde (diff) | |
download | zsh-4b3429d765f1f14f7dbf2cc451e3047388978bf6.tar.gz zsh-4b3429d765f1f14f7dbf2cc451e3047388978bf6.tar.bz2 zsh-4b3429d765f1f14f7dbf2cc451e3047388978bf6.zip |
fixing #812: adding plugins w/o plugin.zsh file to fpath.
-rw-r--r-- | oh-my-zsh.sh | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index aeeaa3daf..732a403b7 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -19,13 +19,19 @@ if [[ -z "$ZSH_CUSTOM" ]]; then ZSH_CUSTOM="$ZSH/custom" fi + +is_plugin() { + local base_dir=$1 + local name=$2 + test -f $base_dir/plugins/$name/$name.plugin.zsh \ + || test -f $base_dir/plugins/$name/_$name +} # Add all defined plugins to fpath. This must be done # before running compinit. -plugin=${plugin:=()} for plugin ($plugins); do - if [ -f $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh ]; then + if is_plugin $ZSH_CUSTOM $plugin; then fpath=($ZSH_CUSTOM/plugins/$plugin $fpath) - elif [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then + elif is_plugin $ZSH $plugin; then fpath=($ZSH/plugins/$plugin $fpath) fi done |