1
0
Fork 0
mirror of synced 2024-11-26 09:15:34 -05:00

Use _zimfw_print

This commit is contained in:
Eric Nielsen 2023-06-15 09:33:14 -05:00
parent f9648e07a9
commit 0566b9b8a3
No known key found for this signature in database
GPG key ID: 678AF5E338C87D99
5 changed files with 9 additions and 25 deletions

View file

@ -8,9 +8,7 @@ _zimfw_check_version() {
fi fi
local -r zlatest_version=$(<${_zversion_target}) local -r zlatest_version=$(<${_zversion_target})
if [[ -n ${zlatest_version} && ${_zversion} != ${zlatest_version} ]]; then if [[ -n ${zlatest_version} && ${_zversion} != ${zlatest_version} ]]; then
if (( _zprintlevel > 0 )); then _zimfw_print -u2 -PR "%F{yellow}Latest zimfw version is %B${zlatest_version}%b. You're using version %B${_zversion}%b. Run %Bzimfw upgrade%b to upgrade.%f"
print -u2 -PR "%F{yellow}Latest zimfw version is %B${zlatest_version}%b. You're using version %B${_zversion}%b. Run %Bzimfw upgrade%b to upgrade.%f"
fi
return 4 return 4
fi fi
} }

View file

@ -3,9 +3,7 @@ _zimfw_compile() {
local zroot_dir zfile local zroot_dir zfile
for zroot_dir in ${_zroot_dirs:|_zdisabled_root_dirs}; do for zroot_dir in ${_zroot_dirs:|_zdisabled_root_dirs}; do
if [[ ! -w ${zroot_dir} ]]; then if [[ ! -w ${zroot_dir} ]]; then
if (( _zprintlevel > 0 )); then _zimfw_print -PR "%F{yellow}<%= warn %>%B${zroot_dir}:%b No write permission, unable to compile.%f"
print -PR "%F{yellow}<%= warn %>%B${zroot_dir}:%b No write permission, unable to compile.%f"
fi
continue continue
fi fi
for zfile in ${zroot_dir}/(^*test*/)#*.zsh(|-theme)(N-.); do for zfile in ${zroot_dir}/(^*test*/)#*.zsh(|-theme)(N-.); do

View file

@ -102,9 +102,7 @@ _zimfw_tool_degit() {
;; ;;
check|update) check|update)
if [[ ! -r ${INFO_TARGET} ]]; then if [[ ! -r ${INFO_TARGET} ]]; then
if (( _zprintlevel > 0 )); then _zimfw_print -u2 -PR <%= clear_line %>"%F{yellow}<%= warn %>%B${_zname}:%b Module was not installed using Zim's degit. Will not try to ${_zaction}. Use zmodule option %B-z%b|%B--frozen%b to disable this warning.%f"
print -u2 -PR <%= clear_line %>"%F{yellow}<%= warn %>%B${_zname}:%b Module was not installed using Zim's degit. Will not try to ${_zaction}. Use zmodule option %B-z%b|%B--frozen%b to disable this warning.%f"
fi
return 0 return 0
fi fi
readonly DIR_NEW=${DIR}${TEMP} readonly DIR_NEW=${DIR}${TEMP}

View file

@ -14,9 +14,7 @@ _zimfw_tool_git() {
;; ;;
check|update) check|update)
if [[ ! -r ${DIR}/.git ]]; then if [[ ! -r ${DIR}/.git ]]; then
if (( _zprintlevel > 0 )); then _zimfw_print -u2 -PR <%= clear_line %>"%F{yellow}<%= warn %>%B${_zname}:%b Module was not installed using git. Will not try to ${_zaction}. Use zmodule option %B-z%b|%B--frozen%b to disable this warning.%f"
print -u2 -PR <%= clear_line %>"%F{yellow}<%= warn %>%B${_zname}:%b Module was not installed using git. Will not try to ${_zaction}. Use zmodule option %B-z%b|%B--frozen%b to disable this warning.%f"
fi
return 0 return 0
fi fi
if [[ ${URL} != $(command git -C ${DIR} config --get remote.origin.url) ]]; then if [[ ${URL} != $(command git -C ${DIR} config --get remote.origin.url) ]]; then

View file

@ -395,9 +395,7 @@ _zimfw_check_version() {
fi fi
local -r zlatest_version=$(<${_zversion_target}) local -r zlatest_version=$(<${_zversion_target})
if [[ -n ${zlatest_version} && ${_zversion} != ${zlatest_version} ]]; then if [[ -n ${zlatest_version} && ${_zversion} != ${zlatest_version} ]]; then
if (( _zprintlevel > 0 )); then _zimfw_print -u2 -PR "%F{yellow}Latest zimfw version is %B${zlatest_version}%b. You're using version %B${_zversion}%b. Run %Bzimfw upgrade%b to upgrade.%f"
print -u2 -PR "%F{yellow}Latest zimfw version is %B${zlatest_version}%b. You're using version %B${_zversion}%b. Run %Bzimfw upgrade%b to upgrade.%f"
fi
return 4 return 4
fi fi
} }
@ -424,9 +422,7 @@ _zimfw_compile() {
local zroot_dir zfile local zroot_dir zfile
for zroot_dir in ${_zroot_dirs:|_zdisabled_root_dirs}; do for zroot_dir in ${_zroot_dirs:|_zdisabled_root_dirs}; do
if [[ ! -w ${zroot_dir} ]]; then if [[ ! -w ${zroot_dir} ]]; then
if (( _zprintlevel > 0 )); then _zimfw_print -PR "%F{yellow}! %B${zroot_dir}:%b No write permission, unable to compile.%f"
print -PR "%F{yellow}! %B${zroot_dir}:%b No write permission, unable to compile.%f"
fi
continue continue
fi fi
for zfile in ${zroot_dir}/(^*test*/)#*.zsh(|-theme)(N-.); do for zfile in ${zroot_dir}/(^*test*/)#*.zsh(|-theme)(N-.); do
@ -439,7 +435,7 @@ _zimfw_compile() {
} }
_zimfw_info() { _zimfw_info() {
print -R 'zimfw version: '${_zversion}' (built at 2023-06-13 16:31:31 UTC, previous commit is db96076)' print -R 'zimfw version: '${_zversion}' (built at 2023-06-15 14:32:20 UTC, previous commit is f9648e0)'
local zparam local zparam
for zparam in LANG ${(Mk)parameters:#LC_*} OSTYPE TERM TERM_PROGRAM TERM_PROGRAM_VERSION ZIM_HOME ZSH_VERSION; do 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} print -R ${(r.22....:.)zparam}${(P)zparam}
@ -650,9 +646,7 @@ _zimfw_tool_degit() {
;; ;;
check|update) check|update)
if [[ ! -r ${INFO_TARGET} ]]; then if [[ ! -r ${INFO_TARGET} ]]; then
if (( _zprintlevel > 0 )); then _zimfw_print -u2 -PR $'\E[2K\r'"%F{yellow}! %B${_zname}:%b Module was not installed using Zim's degit. Will not try to ${_zaction}. Use zmodule option %B-z%b|%B--frozen%b to disable this warning.%f"
print -u2 -PR $'\E[2K\r'"%F{yellow}! %B${_zname}:%b Module was not installed using Zim's degit. Will not try to ${_zaction}. Use zmodule option %B-z%b|%B--frozen%b to disable this warning.%f"
fi
return 0 return 0
fi fi
readonly DIR_NEW=${DIR}${TEMP} readonly DIR_NEW=${DIR}${TEMP}
@ -710,9 +704,7 @@ _zimfw_tool_git() {
;; ;;
check|update) check|update)
if [[ ! -r ${DIR}/.git ]]; then if [[ ! -r ${DIR}/.git ]]; then
if (( _zprintlevel > 0 )); then _zimfw_print -u2 -PR $'\E[2K\r'"%F{yellow}! %B${_zname}:%b Module was not installed using git. Will not try to ${_zaction}. Use zmodule option %B-z%b|%B--frozen%b to disable this warning.%f"
print -u2 -PR $'\E[2K\r'"%F{yellow}! %B${_zname}:%b Module was not installed using git. Will not try to ${_zaction}. Use zmodule option %B-z%b|%B--frozen%b to disable this warning.%f"
fi
return 0 return 0
fi fi
if [[ ${URL} != $(command git -C ${DIR} config --get remote.origin.url) ]]; then if [[ ${URL} != $(command git -C ${DIR} config --get remote.origin.url) ]]; then