1
0
Fork 0
mirror of synced 2024-06-05 16:41:12 -04:00
zimfw/src/stage2/50_zimfw_compile.zsh.erb
Eric Nielsen 26151d2f54
Remove prompt expansion from print statements
and replace the foreground color and bold expansions by ANSI escape
codes. This should make the print calls now safe and no expansion at all
should happen as we're using `-R` -- unless the `-e` flag is given.
Fixes #521. Closes #522
2023-09-16 13:21:14 -05:00

17 lines
627 B
Plaintext

_zimfw_compile() {
# Compile zimfw scripts
local zroot_dir zfile
for zroot_dir in ${_zroot_dirs:|_zdisabled_root_dirs}; do
if [[ ! -w ${zroot_dir} ]]; then
_zimfw_print -R $'<%= yellow %><%= warn %><%= bold %>'${zroot_dir}$':<%= normalyellow %> No write permission, unable to compile.<%= normal %>'
continue
fi
for zfile in ${zroot_dir}/(^*test*/)#*.zsh(|-theme)(N-.); do
if [[ ! ${zfile}.zwc -nt ${zfile} ]]; then
zcompile -UR ${zfile} && _zimfw_print -R $'<%= okay %><%= bold %>'${zfile}$'.zwc:<%= normal %> Compiled'
fi
done
done
_zimfw_print 'Done with compile.'
}