Warn when module isn't installed with current tool
instead of showing it as an error. This change allow the message to be omitted with `-q`.
This commit is contained in:
parent
de7d2b131f
commit
a86f69a2f1
3 changed files with 17 additions and 9 deletions
|
@ -112,8 +112,10 @@ case ${ACTION} in
|
||||||
update)
|
update)
|
||||||
if [[ -r ${DIR}/.zim_degit_info ]] command mv -f ${DIR}/.zim_degit_info ${INFO_TARGET}
|
if [[ -r ${DIR}/.zim_degit_info ]] command mv -f ${DIR}/.zim_degit_info ${INFO_TARGET}
|
||||||
if [[ ! -r ${INFO_TARGET} ]]; then
|
if [[ ! -r ${INFO_TARGET} ]]; then
|
||||||
print_error "Module was not installed using Zim's degit. Will not try to update. You can disable this with the zmodule option -z|--frozen."
|
if (( PRINTLEVEL > 0 )); then
|
||||||
return 1
|
print -u2 -PR <%= clear_line %>"%F{yellow}<%= warn %>%B${MODULE}:%b Module was not installed using Zim's degit. Will not try to update. You can disable this with the zmodule option -z|--frozen.%f"
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
fi
|
fi
|
||||||
readonly DIR_NEW=${DIR}${TEMP}
|
readonly DIR_NEW=${DIR}${TEMP}
|
||||||
{
|
{
|
||||||
|
|
|
@ -26,8 +26,10 @@ case ${ACTION} in
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
if [[ ${PWD:A} != ${"$(command git rev-parse --show-toplevel 2>/dev/null)":A} ]]; then
|
if [[ ${PWD:A} != ${"$(command git rev-parse --show-toplevel 2>/dev/null)":A} ]]; then
|
||||||
print_error "Module was not installed using git. Will not try to update. You can disable this with the zmodule option -z|--frozen."
|
if (( PRINTLEVEL > 0 )); then
|
||||||
return 1
|
print -u2 -PR <%= clear_line %>"%F{yellow}<%= warn %>%B${MODULE}:%b Module was not installed using git. Will not try to update. You can disable this with the zmodule option -z|--frozen.%f"
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
fi
|
fi
|
||||||
if [[ ${URL} != $(command git config --get remote.origin.url) ]]; then
|
if [[ ${URL} != $(command git config --get remote.origin.url) ]]; then
|
||||||
print_error "URL does not match. Expected ${URL}. Will not try to update."
|
print_error "URL does not match. Expected ${URL}. Will not try to update."
|
||||||
|
|
14
zimfw.zsh
14
zimfw.zsh
|
@ -373,7 +373,7 @@ _zimfw_compile() {
|
||||||
}
|
}
|
||||||
|
|
||||||
_zimfw_info() {
|
_zimfw_info() {
|
||||||
print -R 'zimfw version: '${_zversion}' (built at 2021-09-29 22:29:57 UTC, previous commit is 1d5c0c1)'
|
print -R 'zimfw version: '${_zversion}' (built at 2021-10-19 13:32:17 UTC, previous commit is de7d2b1)'
|
||||||
print -R 'ZIM_HOME: '${ZIM_HOME}
|
print -R 'ZIM_HOME: '${ZIM_HOME}
|
||||||
print -R 'Zsh version: '${ZSH_VERSION}
|
print -R 'Zsh version: '${ZSH_VERSION}
|
||||||
print -R 'System info: '$(command uname -a)
|
print -R 'System info: '$(command uname -a)
|
||||||
|
@ -590,8 +590,10 @@ case \${ACTION} in
|
||||||
update)
|
update)
|
||||||
if [[ -r \${DIR}/.zim_degit_info ]] command mv -f \${DIR}/.zim_degit_info \${INFO_TARGET}
|
if [[ -r \${DIR}/.zim_degit_info ]] command mv -f \${DIR}/.zim_degit_info \${INFO_TARGET}
|
||||||
if [[ ! -r \${INFO_TARGET} ]]; then
|
if [[ ! -r \${INFO_TARGET} ]]; then
|
||||||
print_error \"Module was not installed using Zim's degit. Will not try to update. You can disable this with the zmodule option -z|--frozen.\"
|
if (( PRINTLEVEL > 0 )); then
|
||||||
return 1
|
print -u2 -PR $'\E[2K\r'\"%F{yellow}! %B\${MODULE}:%b Module was not installed using Zim's degit. Will not try to update. You can disable this with the zmodule option -z|--frozen.%f\"
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
fi
|
fi
|
||||||
readonly DIR_NEW=\${DIR}\${TEMP}
|
readonly DIR_NEW=\${DIR}\${TEMP}
|
||||||
{
|
{
|
||||||
|
@ -646,8 +648,10 @@ case \${ACTION} in
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
if [[ \${PWD:A} != \${\"\$(command git rev-parse --show-toplevel 2>/dev/null)\":A} ]]; then
|
if [[ \${PWD:A} != \${\"\$(command git rev-parse --show-toplevel 2>/dev/null)\":A} ]]; then
|
||||||
print_error \"Module was not installed using git. Will not try to update. You can disable this with the zmodule option -z|--frozen.\"
|
if (( PRINTLEVEL > 0 )); then
|
||||||
return 1
|
print -u2 -PR $'\E[2K\r'\"%F{yellow}! %B\${MODULE}:%b Module was not installed using git. Will not try to update. You can disable this with the zmodule option -z|--frozen.%f\"
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
fi
|
fi
|
||||||
if [[ \${URL} != \$(command git config --get remote.origin.url) ]]; then
|
if [[ \${URL} != \$(command git config --get remote.origin.url) ]]; then
|
||||||
print_error \"URL does not match. Expected \${URL}. Will not try to update.\"
|
print_error \"URL does not match. Expected \${URL}. Will not try to update.\"
|
||||||
|
|
Loading…
Reference in a new issue