Add dependency check for docker & compose

pull/55/head
Dan Caseley 2022-07-06 18:38:28 +01:00 committed by Guus der Kinderen
parent 346a4e4005
commit 33d97f94de
2 changed files with 13 additions and 0 deletions

View File

@ -7,3 +7,14 @@ pushd () {
popd () {
command popd "$@" > /dev/null
}
check_deps () {
if ! which docker > /dev/null; then
echo "ERROR: docker is not installed."
exit 1
fi
if ! docker compose version > /dev/null; then
echo "ERROR: docker compose is not installed, or is too old."
exit 1
fi
}

View File

@ -15,6 +15,8 @@ SCRIPTPATH="$( cd "$(dirname "$0")"; pwd -P )"
source "$SCRIPTPATH/../_common/functions.sh"
check_deps
while getopts n:h o; do
case "$o" in
n)