Changes are:
* Don't compile in the background anymore, only via the `zimfw` tool
after actions where scripts can change (build, install, update)
* Move compilation of the completion dumpfile to the completion module:
9386a76eac/init.zsh (L10-L11)
* Don't compile users startup scripts anymore (.zshenv, .zshrc, etc.)
* Make output of `zimfw init` friendlier for the terminal startup
screen when called without `-q`.
See https://github.com/romkatv/zsh-bench/pull/11#issuecomment-994979683
and https://github.com/romkatv/zsh-bench#cutting-corners
Regarding not compiling users startup scripts anymore, I'm choosing to
only compile the modules' scripts at least for the reason that compile
won't happen so ofter anymore -- it will only happen when the user calls
the `zimfw` build, install or update actions. So it makes more sense to
only compile the files that `zimfw` has control over changes...
Closes #450
14 lines
525 B
Plaintext
14 lines
525 B
Plaintext
_zimfw_compile() {
|
|
# Array with unique dirs. ${ZIM_HOME} or any subdirectory should only occur once.
|
|
local -Ur zscriptdirs=(${ZIM_HOME} ${${_zdirs##${ZIM_HOME}/*}:A})
|
|
# Compile Zim scripts
|
|
local zfile
|
|
for zfile in ${^zscriptdirs}/(^*test*/)#*.zsh(|-theme)(N-.); do
|
|
if [[ ! ${zfile}.zwc -nt ${zfile} ]]; then
|
|
zcompile -R ${zfile} && \
|
|
if (( _zprintlevel > 0 )) print -PR "<%= okay %>%B${zfile}.zwc:%b Compiled"
|
|
fi
|
|
done
|
|
if (( _zprintlevel > 0 )) print -P '<%= done %>Done with compile.'
|
|
}
|