verify command presence only if needed
This commit is contained in:
parent
0503838b5b
commit
a3fb426ecf
|
@ -454,29 +454,29 @@ PATH=${PATH}:/usr/sbin
|
||||||
|
|
||||||
SENDMAIL_BIN=$(command -v sendmail)
|
SENDMAIL_BIN=$(command -v sendmail)
|
||||||
readonly SENDMAIL_BIN
|
readonly SENDMAIL_BIN
|
||||||
if [ -z "${SENDMAIL_BIN}" ]; then
|
if [ "${HOOK_MAIL}" = "1" ] && [ -z "${SENDMAIL_BIN}" ]; then
|
||||||
echo "No \`sendmail' command has been found, can't send mail." 2>&1
|
echo "No \`sendmail' command has been found, can't send mail." 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
GIT_BIN=$(command -v git)
|
GIT_BIN=$(command -v git)
|
||||||
readonly GIT_BIN
|
readonly GIT_BIN
|
||||||
if [ -z "${GIT_BIN}" ]; then
|
if [ "${HOOK_COMMIT}" = "1" ] && [ -z "${GIT_BIN}" ]; then
|
||||||
echo "No \`git' command has been found, can't commit changes" 2>&1
|
echo "No \`git' command has been found, can't commit changes" 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PSQL_BIN=$(command -v psql)
|
PSQL_BIN=$(command -v psql)
|
||||||
readonly PSQL_BIN
|
readonly PSQL_BIN
|
||||||
if [ -z "${PSQL_BIN}" ]; then
|
if [ "${HOOK_DB}" = "1" ] && [ -z "${PSQL_BIN}" ]; then
|
||||||
echo "No \`psql' command has been found, can't save to the database." 2>&1
|
echo "No \`psql' command has been found, can't save to the database." 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CURL_BIN=$(command -v curl)
|
CURL_BIN=$(command -v curl)
|
||||||
readonly CURL_BIN
|
readonly CURL_BIN
|
||||||
if [ -z "${CURL_BIN}" ]; then
|
if [ "${HOOK_API}" = "1" ] && [ -z "${CURL_BIN}" ]; then
|
||||||
echo "No \`curl' command has been found, can't call the API." 2>&1
|
echo "No \`curl' command has been found, can't call the API." 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "${API_ENDPOINT}" ]; then
|
if [ "${HOOK_API}" = "1" ] && [ -z "${API_ENDPOINT}" ]; then
|
||||||
echo "No API endpoint specified, can't call the API." 2>&1
|
echo "No API endpoint specified, can't call the API." 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue