mirror of https://github.com/zimfw/zimfw.git
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
pull/453/head
parent
90de91ab4f
commit
cfc955c9fd
@ -1,5 +1,13 @@ |
||||
_zimfw_compile() { |
||||
local zopt |
||||
if (( _zprintlevel <= 0 )) zopt=-q |
||||
source ${ZIM_HOME}/login_init.zsh ${zopt} |
||||
# 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.' |
||||
} |
||||
|
@ -1,5 +1,3 @@ |
||||
_zimfw_install_update() { |
||||
_zimfw_source_zimrc 1 ${1} && \ |
||||
zargs -n 9 -P 0 -- "${_zmodules_zargs[@]}" -- _zimfw_run_tool && \ |
||||
_zimfw_print -PR "<%= done %>Done with ${1}. Restart your terminal for any changes to take effect." |
||||
_zimfw_source_zimrc 1 ${1} && zargs -n 9 -P 0 -- "${_zmodules_zargs[@]}" -- _zimfw_run_tool |
||||
} |
||||
|
@ -1,24 +1 @@ |
||||
() { |
||||
builtin emulate -L zsh |
||||
setopt EXTENDED_GLOB |
||||
autoload -Uz zrecompile |
||||
local zdumpfile zfile |
||||
|
||||
# Compile the completion cache; significant speedup |
||||
zstyle -s ':zim:completion' dumpfile 'zdumpfile' || zdumpfile=<%= home %>/.zcompdump |
||||
if [[ -f ${zdumpfile} ]]; then |
||||
zrecompile -p ${1} ${zdumpfile} || return 1 |
||||
fi |
||||
|
||||
# Compile Zsh startup files |
||||
for zfile in <%= home %>/<%= startup_files_glob %>(N-.); do |
||||
zrecompile -p ${1} ${zfile} || return 1 |
||||
done |
||||
|
||||
# Compile Zim scripts |
||||
for zfile in #{zscriptglob}; do |
||||
zrecompile -p ${1} ${zfile} || return 1 |
||||
done |
||||
|
||||
if [[ ${1} != -q ]] print -P '<%= done %>Done with compile.' |
||||
} "${@}" |
||||
# Do nothing. This file is deprecated. |
||||
|
Loading…
Reference in new issue