Skip to content

Commit

Permalink
Merge pull request ohmyzsh#840 from arbovm/master
Browse files Browse the repository at this point in the history
fixing ohmyzsh#812: adding plugins w/o plugin.zsh file to fpath.
  • Loading branch information
robbyrussell committed Jan 16, 2012
2 parents eabd6fa + 4b3429d commit 1a0be15
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions oh-my-zsh.sh
Expand Up @@ -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
Expand Down

0 comments on commit 1a0be15

Please sign in to comment.