pmd/.ci/check-environment.sh

43 lines
622 B
Bash
Raw Normal View History

2020-11-10 22:26:26 +01:00
#!/usr/bin/env bash
#
# This script should check, that all needed commands are available
# and are in the correct version.
#
source $(dirname $0)/inc/logger.inc
2020-11-10 22:26:26 +01:00
set -e
2020-11-11 21:15:04 +01:00
function check() {
local CMD=$1
local VERSION_CMD=$2
echo -n "Checking ${CMD}..."
if [ hash "$CMD" 2>/dev/null ]; then
echo -e "${COL_GREEN}OK${COL_RESET}"
else
echo -e "${COL_RED}failure${COL_RESET}"
fi
}
2020-11-11 21:15:04 +01:00
# every OS:
# curl
# jq
# linux only
2020-11-10 22:26:26 +01:00
ruby --version | grep "ruby 2.7" || (log_error "Ruby is missing"; exit 1)
check "ruby" "ruby --version"
# gpg
# printenv
# rsync
# ssh
2020-11-12 10:42:19 +01:00
# git
2020-11-11 21:15:04 +01:00
# windows only
# 7zip