Handle module root directories without write permission

Closes #513. Fixes #512
This commit is contained in:
alesandar 2023-06-15 17:26:37 +03:00 committed by GitHub
parent db96076cf0
commit f9648e07a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View File

@ -2,6 +2,12 @@ _zimfw_compile() {
# Compile Zim scripts
local zroot_dir zfile
for zroot_dir in ${_zroot_dirs:|_zdisabled_root_dirs}; do
if [[ ! -w ${zroot_dir} ]]; then
if (( _zprintlevel > 0 )); then
print -PR "%F{yellow}<%= warn %>%B${zroot_dir}:%b No write permission, unable to compile.%f"
fi
continue
fi
for zfile in ${zroot_dir}/(^*test*/)#*.zsh(|-theme)(N-.); do
if [[ ! ${zfile}.zwc -nt ${zfile} ]]; then
zcompile -UR ${zfile} && _zimfw_print -PR "<%= okay %>%B${zfile}.zwc:%b Compiled"

View File

@ -423,6 +423,12 @@ _zimfw_compile() {
# Compile Zim scripts
local zroot_dir zfile
for zroot_dir in ${_zroot_dirs:|_zdisabled_root_dirs}; do
if [[ ! -w ${zroot_dir} ]]; then
if (( _zprintlevel > 0 )); then
print -PR "%F{yellow}! %B${zroot_dir}:%b No write permission, unable to compile.%f"
fi
continue
fi
for zfile in ${zroot_dir}/(^*test*/)#*.zsh(|-theme)(N-.); do
if [[ ! ${zfile}.zwc -nt ${zfile} ]]; then
zcompile -UR ${zfile} && _zimfw_print -PR "%F{green})%f %B${zfile}.zwc:%b Compiled"
@ -433,7 +439,7 @@ _zimfw_compile() {
}
_zimfw_info() {
print -R 'zimfw version: '${_zversion}' (built at 2023-04-01 01:32:16 UTC, previous commit is 5db1155)'
print -R 'zimfw version: '${_zversion}' (built at 2023-06-13 16:31:31 UTC, previous commit is db96076)'
local zparam
for zparam in LANG ${(Mk)parameters:#LC_*} OSTYPE TERM TERM_PROGRAM TERM_PROGRAM_VERSION ZIM_HOME ZSH_VERSION; do
print -R ${(r.22....:.)zparam}${(P)zparam}