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

@@ -246,9 +246,8 @@ function configure_system() {
popd -q
}
function checkPrerequisites() {
local -A cmds=(
[docopts]='(with -f option supported)'
function getExecPrerequisites() {
cmds=(
[dscl]=''
[dseditgroup]=''
[chown]=''
@@ -259,8 +258,7 @@ function checkPrerequisites() {
[awk]=''
[sysadminctl]=''
)
test "`id -u`" -eq 0 || { lop -- -e 'This module requires root access. Please run as root.'; return 11 }
checkCommands
requireRootPrivileges
}
function getDefaultHomebrewUsername() {