Jakub Sokołowski 261b81c8a7
nix: upgrade: 2.2.1 > 2.3.1
also drop toolversion scripts and functions

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2019-11-26 16:30:22 +01:00

28 lines
511 B
Bash
Executable File

#!/usr/bin/env bash
########
# Install checks
########
GIT_ROOT=$(cd "${BASH_SOURCE%/*}" && git rev-parse --show-toplevel)
function program_exists() {
local program=$1
command -v "$program" >/dev/null 2>&1
}
function program_version_exists() {
local program=$1
if ! program_exists "$program"; then
$(exit 1)
return
fi
local required_version=$2
if echo "$($program --version)" | grep -q -wo "$required_version\|$required_version[^\.]"; then
$(exit 0)
return
fi
$(exit 1)
}