1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-11-22 05:40:08 +00:00

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

This commit is contained in:
Arbo von Monkiewitsch 2012-01-16 18:21:27 +01:00
parent 7a41498b0d
commit 4b3429d765

View file

@ -19,13 +19,19 @@ if [[ -z "$ZSH_CUSTOM" ]]; then
ZSH_CUSTOM="$ZSH/custom" ZSH_CUSTOM="$ZSH/custom"
fi 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 # Add all defined plugins to fpath. This must be done
# before running compinit. # before running compinit.
plugin=${plugin:=()}
for plugin ($plugins); do 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) 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) fpath=($ZSH/plugins/$plugin $fpath)
fi fi
done done