diff options
author | Robby Russell <robby@planetargon.com> | 2012-01-16 13:21:48 -0800 |
---|---|---|
committer | Robby Russell <robby@planetargon.com> | 2012-01-16 13:21:48 -0800 |
commit | 1a0be15d8c9c008eeeca57b820fe090fcbf9c59a (patch) | |
tree | abb9bd6f49acff34a7b8ae6af33e004e60b02e74 /oh-my-zsh.sh | |
parent | eabd6fa30308a76d6af278a6b0ec1e6445a82d36 (diff) | |
parent | 4b3429d765f1f14f7dbf2cc451e3047388978bf6 (diff) | |
download | zsh-1a0be15d8c9c008eeeca57b820fe090fcbf9c59a.tar.gz zsh-1a0be15d8c9c008eeeca57b820fe090fcbf9c59a.tar.bz2 zsh-1a0be15d8c9c008eeeca57b820fe090fcbf9c59a.zip |
Merge pull request #840 from arbovm/master
fixing #812: adding plugins w/o plugin.zsh file to fpath.
Diffstat (limited to 'oh-my-zsh.sh')
-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 |