Move checkCommands to zshlib
This commit is contained in:
@@ -40,22 +40,10 @@ function ensurePathOrLogError() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkCommands() {
|
|
||||||
local cmd
|
|
||||||
for cmd in ${(k)cmds}; do
|
|
||||||
if ! which "${cmd}" >&! /dev/null; then
|
|
||||||
local comment=''
|
|
||||||
[ -n "${cmds[$cmd]}" ] && comment=" ${cmds[$cmd]}"
|
|
||||||
lop -- -e "This module needs ${cmd}${comment} to work."
|
|
||||||
return 11
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
function checkHelpPrerequisites() {
|
function checkHelpPrerequisites() {
|
||||||
local -A cmds
|
local -A cmds
|
||||||
getHelpPrerequisites || return
|
getHelpPrerequisites || return
|
||||||
checkCommands
|
checkCommands ${(k)cmds}
|
||||||
}
|
}
|
||||||
|
|
||||||
function addDocoptsToCmds() {
|
function addDocoptsToCmds() {
|
||||||
@@ -73,13 +61,13 @@ whence getHelpPrerequisites >&! /dev/null || function $_() {
|
|||||||
function checkQuestionsPrerequisites() {
|
function checkQuestionsPrerequisites() {
|
||||||
local -A cmds
|
local -A cmds
|
||||||
getQuestionsPrerequisites || return
|
getQuestionsPrerequisites || return
|
||||||
checkCommands
|
checkCommands ${(k)cmds}
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkExecPrerequisites() {
|
function checkExecPrerequisites() {
|
||||||
local -A cmds
|
local -A cmds
|
||||||
getExecPrerequisites || return
|
getExecPrerequisites || return
|
||||||
checkCommands
|
checkCommands ${(k)cmds}
|
||||||
}
|
}
|
||||||
|
|
||||||
function showQuestions() {
|
function showQuestions() {
|
||||||
|
|||||||
2
zshlib
2
zshlib
Submodule zshlib updated: a20db501bd...174bc62804
Reference in New Issue
Block a user