Split prerequisites check into three stages

This commit is contained in:
Rezart Qelibari
2022-04-06 16:43:04 +02:00
parent 7f55fb66f8
commit 77c0ac8cdf
5 changed files with 75 additions and 30 deletions

View File

@@ -94,14 +94,11 @@ function configure_system() {
popd -q
}
function checkPrerequisites() {
local -A cmds=(
[docopts]='(with -f option supported)'
)
local -A execCmds=(
function getExecPrerequisites() {
cmds=(
[brew]=''
)
test "`id -u`" -eq 0 || { lop -- -e 'This module requires root access. Please run as root.'; return 11 }
id -nG | grep admin >&! /dev/null || { lop -- -e 'This module requires the user to be in admin group. Please run again as either root or an admin user.'; return 11 }
checkCommands
}