Skip to content
Browse files

support {sysname}.d dirs in a plugin- run all files inside during the…

… {sysname} startup phase
  • Loading branch information...
1 parent d5667aa commit d91eb5d3dc42e79771585cdfd300eb1ba14cd00f @rsanders committed
Showing with 14 additions and 1 deletion.
  1. +2 −1 zsh/core/zshenv
  2. +5 −0 zsh/functions/useplugin
  3. +7 −0 zsh/functions/zrunsystem
View
3 zsh/core/zshenv
@@ -54,9 +54,10 @@ function () {
dotto_zsh_plugins+=(dotto_core)
# arrays we use for hook-like purposes
+ local _zsysname
for _zsysname in zprofile zshrc zcomp zperiodic zlogin zlogout newshell
do
- typeset -g -a -U ${_zsysname}_files ${_zsysname}_functions
+ typeset -g -a -U ${_zsysname}_files ${_zsysname}_functions ${_zsysname}_dirs
done
if [[ $DOTTO_PROFILING == 1 && $dotto_vars[dotto_profiling_started] != 1 ]]; then
View
5 zsh/functions/useplugin
@@ -66,6 +66,11 @@
set -A $hookname ${(P)hookname} $dir/${system}.zsh
fi
+ if [[ -r $dir/${system}.d ]]; then
+ hookname=${system}_dirs
+ set -A $hookname ${(P)hookname} $dir/${system}.d
+ fi
+
# if this system has already been initialized, go ahead and
# run the plugin's init for that system rather than waiting
if set~contains zsystem_done $system; then
View
7 zsh/functions/zrunsystem
@@ -93,6 +93,13 @@ function zrunsystem_libs() {
for zfile in $zrlfunctions; do
${=zfile}
done
+
+ # run any zshrc.d-type dirs
+ arrayname=${systemname%.d}_dirs
+ zrlfunctions=(${(P)arrayname})
+ set -A $arrayname
+
+ zsyssourcedir $systemname $zrlfunctions
}
function zrunsystem() {

0 comments on commit d91eb5d

Please sign in to comment.
Something went wrong with that request. Please try again.