Add possiblity to check only runtime dependencies

This commit is contained in:
Rezart Qelibari
2022-04-05 16:14:34 +02:00
parent 4296814786
commit f9131f8682

View File

@@ -29,10 +29,11 @@ function getModuleAnswerByKeyRegEx() {
function checkCommands() { function checkCommands() {
local cmd local cmd
for cmd in ${(k)cmds}; do local varName=$1
for cmd in ${(Pk)varName}; do
if ! which "${cmd}" >&! /dev/null; then if ! which "${cmd}" >&! /dev/null; then
local comment='' local comment=''
[ -n "${cmds[$cmd]}" ] && comment=" ${cmds[$cmd]}" [ -n "${${(P)varName}[$cmd]}" ] && comment=" ${${(P)varName}[$cmd]}"
lop -- -e "This module needs ${cmd}${comment} to work." lop -- -e "This module needs ${cmd}${comment} to work."
return 11 return 11
fi fi
@@ -51,10 +52,11 @@ function module_main() {
local cmdName=${1:t} local cmdName=${1:t}
shift shift
autoloadZShLib || return autoloadZShLib || return
checkPrerequisites || return checkPrerequisites cmds || return
configureLogging configureLogging
eval "`getUsage $cmdName | docopts -f -V - -h - : "$@"`" eval "`getUsage $cmdName | docopts -f -V - -h - : "$@"`"
[ $# -lt 1 ] && return [ $# -lt 1 ] && return
[ "${show_questions}" = true ] && { showQuestions; return } [ "${show_questions}" = true ] && { showQuestions; return }
checkPrerequisites execCmds || return
configure_system configure_system
} }