1
0
Fork 0
mirror of synced 2024-05-28 04:51:11 -04:00
zimfw/src/stage2/50_zimfw_clean_compiled.zsh.erb
Eric Nielsen dfe35e1bfa
Generate static init.zsh script \o/
to autoloads the functions and sources the scripts, instead of executing
zimfw during startup, and having it always figuring out what do to on
the fly.

This takes out the worry about zimfw interfering with the startup time,
and allows room to add more features to it. So, zstyle was replaced by a
custom zmodule function to define the modules, with the extra ability of
allowing users to set custom fpath paths, autoloaded functions and
sourced scripts per module.
2020-01-02 12:58:01 -05:00

19 lines
624 B
Plaintext

_zimfw_clean_compiled() {
local zopt_find zopt_rm zdir
if (( ! _zquiet )); then
zopt_find='-print'
zopt_rm='-v'
fi
for zdir in ${fpath}; do
[[ ${zdir} == (.|..) || ${zdir} == (.|..)/* ]] && continue
if [[ -w ${zdir:h} ]]; then
command rm -f ${zopt_rm} ${zdir}.zwc{,.old} || return 1
fi
done
command find ${ZIM_HOME} \( -name '*.zwc' -o -name '*.zwc.old' \) -delete ${zopt_find} || return 1
command rm -f ${zopt_rm} <%= home %>/.zshrc.zwc{,.old} || return 1
if (( ! _zquiet )); then
print -P '%F{green}✓%f Done with clean-compiled. Run %Bzimfw compile%b to re-compile.'
fi
}