dependency check adjustment

Co-authored-by: yubiuser <github@yubiuser.dev>
Signed-off-by: Michael Woolweaver <michael@woolweaver.bid>
This commit is contained in:
Michael Woolweaver
2025-04-02 18:27:55 -05:00
parent 589b6df862
commit 21e6ac0d8a
2 changed files with 24 additions and 3 deletions

22
padd.sh
View File

@@ -1516,15 +1516,31 @@ secretRead() {
}
check_dependencies() {
local hasDeps=true
# Check for required dependencies
if ! command -v curl >/dev/null 2>&1; then
printf "%b" "${check_box_bad} Error!\n 'curl' is missing but required.\n"
exit 1
hasDeps=false
fi
if ! command -v jq >/dev/null 2>&1; then
printf "%b" "${check_box_bad} Error!\n 'jq' is missing but required.\n"
exit 1
printf "%b" "${check_box_bad} Error!\n 'jq' is missing but required.\n"
hasDeps=false
fi
if ! command -v dig >/dev/null 2>&1; then
printf "%b" "${check_box_bad} Error!\n 'dig' is missing but required.\n"
hasDeps=false
fi
if ! command -v tput >/dev/null 2>&1; then
printf "%b" "${check_box_bad} Error!\n 'tput' is missing but required.\n"
hasDeps=false
fi
if ! [ "${hasDeps}" = true ]; then
printf "%b" "\n Please install the missing dependencies noted above.\n"
exit 1
fi
}