mirror of
https://github.com/Pmodules/Pmodules.git
synced 2026-06-27 18:13:08 +02:00
better solution to define used commands implemented
This commit is contained in:
@@ -35,6 +35,17 @@ std::die() {
|
||||
exit $ec
|
||||
}
|
||||
|
||||
std::def_cmds(){
|
||||
local path="$1"
|
||||
shift
|
||||
for cmd in "$@"; do
|
||||
eval declare -g ${cmd}=$(PATH="${path}" which $cmd 2>/dev/null)
|
||||
if [[ -z "${!cmd}" ]]; then
|
||||
std::die 255 "${cmd} not found"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
#
|
||||
# get answer to yes/no question
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user