1
0
mirror of https://github.com/zplug/zplug synced 2025-04-05 15:19:13 +02:00
zplug/base/utils/prezto.zsh
Yann Hodique 1188792ce0 load functions-only prezto modules
Some prezto modules (like `archive`) don't have a .zsh at all
2017-01-16 18:26:51 -08:00

24 lines
585 B
Bash

__zplug::utils::prezto::depends()
{
local module="$1"
local -a -U dependencies
local prezto_repo="$ZPLUG_REPOS/$_ZPLUG_PREZTO"
dependencies=()
# Note: Probably the only match is init.zsh, but just in case
for module_f in "$prezto_repo"/modules/$module/*.zsh(N)
do
dependencies+=( ${(@s: :)"$( \
grep "\bpmodload\b" "$module_f" 2>/dev/null \
| sed 's/pmodload *'// \
| sed "s/['\"]//g"
)"} )
done
for dep in "${dependencies[@]}"
do
echo "$dep"
done
}