Test better "missing dependencies" layout.

This commit is contained in:
purple 2023-09-11 16:23:49 +02:00
parent efc5bd6763
commit 7538050826

View file

@ -141,60 +141,45 @@ quit_red() { log_red "$1"; exit 1; }
depend() { depend() {
# Check for required dependencies. # Check for required dependencies.
if ! [ -x "$(command -v unzip)" ]; then if ! [ -x "$(command -v unzip)" ]; then DEPEND_MISSING=true; fi
log_red '[FATAL] Required dependency "unzip" is not installed or detected.' >&2 if ! [ -x "$(command -v node) " ]; then DEPEND_MISSING=true; fi
DEPEND_MISSING=true if ! [ -x "$(command -v yarn) " ]; then DEPEND_MISSING=true; fi
fi; if ! [ -x "$(command -v node)" ]; then if ! [ -x "$(command -v zip) " ]; then DEPEND_MISSING=true; fi
log_red '[FATAL] Required dependency "node" is not installed or detected.' >&2 if ! [ -x "$(command -v curl) " ]; then DEPEND_MISSING=true; fi
DEPEND_MISSING=true if ! [ -x "$(command -v sed) " ]; then DEPEND_MISSING=true; fi
fi; if ! [ -x "$(command -v yarn)" ]; then if ! [ -x "$(command -v php) " ]; then DEPEND_MISSING=true; fi
log_red '[FATAL] Required dependency "yarn" is not installed or detected.' >&2
DEPEND_MISSING=true
fi; if ! [ -x "$(command -v zip)" ]; then
log_red '[FATAL] Required dependency "zip" is not installed or detected.' >&2
DEPEND_MISSING=true
fi; if ! [ -x "$(command -v curl)" ]; then
log_red '[FATAL] Required dependency "curl" is not installed or detected.' >&2
DEPEND_MISSING=true
fi; if ! [ -x "$(command -v sed)" ]; then
log_red '[FATAL] Required dependency "sed" is not installed or detected.' >&2
DEPEND_MISSING=true
fi; if ! [ -x "$(command -v php)" ]; then
log_red '[FATAL] Required dependency "php" is not installed or detected.' >&2
DEPEND_MISSING=true
fi
# End process when using an older Node.JS version. # End process when using an older Node.JS version.
nodeVer=$(node -v) nodeVer=$(node -v)
if [[ $nodeVer != "v17."* ]] && if [[ $nodeVer != "v17."* ]] && [[ $nodeVer != "v18."* ]] && [[ $nodeVer != "v19."* ]] && [[ $nodeVer != "v20."* ]] && [[ $nodeVer != "v21."* ]]; then DEPEND_MISSING=true; fi
[[ $nodeVer != "v18."* ]] &&
[[ $nodeVer != "v19."* ]] &&
[[ $nodeVer != "v20."* ]] &&
[[ $nodeVer != "v21."* ]]; then
log_red '[FATAL] Required dependency "node" is an unsupported version.' >&2
DEPEND_MISSING=true
fi
# Check for internal dependencies. # Check for internal dependencies.
if [[ $LIB__bash_colors ]]; then if [[ $LIB__bash_colors ]]; then DEPEND_MISSING=true; fi
log_red '[FATAL] Internal dependency "bash_colors" is not installed or detected.' >&2 if [[ $LIB__parse_yaml ]]; then DEPEND_MISSING=true; fi
DEPEND_MISSING=true if [[ $LIB__db ]]; then DEPEND_MISSING=true; fi
fi; if [[ $LIB__parse_yaml ]]; then if [[ $LIB__telemetry ]]; then DEPEND_MISSING=true; fi
log_red '[FATAL] Internal dependency "parse_yaml" is not installed or detected.' >&2 if [[ $LIB__updateAdminCacheReminder ]]; then DEPEND_MISSING=true; fi
DEPEND_MISSING=true
fi; if [[ $LIB__db ]]; then
log_red '[FATAL] Internal dependency "db" is not installed or detected.' >&2
DEPEND_MISSING=true
fi; if [[ $LIB__telemetry ]]; then
log_red '[FATAL] Internal dependency "telemetry" is not installed or detected.' >&2
DEPEND_MISSING=true
fi; if [[ $LIB__updateAdminCacheReminder ]]; then
log_red '[FATAL] Internal dependency "updateAdminCacheReminder" is not installed or detected.' >&2
DEPEND_MISSING=true
fi
# Exit when missing dependencies. # Exit when missing dependencies.
if [[ $DEPEND_MISSING == true ]]; then exit 1; fi if [[ $DEPEND_MISSING == true ]]; then
log_red "[FATAL] Blueprint found errors for the following dependencies:"
log_red " - \"node\" ($nodeVer) is an unsupported version."
log_red " - \"unzip\" is not installed or detected."
log_red " - \"node\" is not installed or detected."
log_red " - \"yarn\" is not installed or detected."
log_red " - \"zip\" is not installed or detected."
log_red " - \"curl\" is not installed or detected."
log_red " - \"sed\" is not installed or detected."
log_red " - \"php\" is not installed or detected."
log_red " - \"internal:bash_colors\" is not installed or detected."
log_red " - \"internal:parse_yaml\" is not installed or detected."
log_red " - \"internal:db\" is not installed or detected."
log_red " - \"internal:telemetry\" is not installed or detected."
log_red " - \"internal:updateAdminCacheReminder\" is not installed or detected."
fi
} }