-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path:za-eval-atinit-handler
30 lines (26 loc) · 1 KB
/
:za-eval-atinit-handler
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Copyright (c) 2021-2023 Nicholas Serrano
# License MIT
emulate -RL zsh
setopt extendedglob typesetsilent noshortloops
if [[ "$1" = plugin ]] {
local type="$1" user="$2" plugin="$3" id_as="$4" dir="${5#%}" hook="$6" update="$7"
} else {
local type="$1" url="$2" id_as="$3" dir="${4#%}" hook="$5" update="$6"
}
#
# eval'' ice – Add cache file to sourced file list, recreate cache if missing
#
if [[ -n ${ICE[eval]} ]] {
typeset -i ZINIT_Z_A_EVAL_SOURCED=0
local cachefile="$dir/evalcache.zsh"
ICE[multisrc]="$ICE[multisrc] $cachefile"
# ZINIT[annex-multi-flag:pull-active] does not seem to reset between plugins during atinit,
# switching to undocumented update flag which does
if [[ ! -r "$cachefile" && ${update:-update:0} == update:0 ]] {
[[ -w $dir ]] && {
(( ${+functions[.zinit-store-ices]} )) || builtin source ${ZINIT[BIN_DIR]}"/zinit-side.zsh"
.zinit-store-ices "$dir/._zinit" ICE "" "" "" ""
}
:za-eval-atclone-handler "$1" "$2" "$3" "$4" "$5" "$6"
}
}