bats: check for yq version (#1355)

This commit is contained in:
mmetc 2022-03-15 15:03:56 +01:00 committed by GitHub
parent 6d42a8c8be
commit b09339ae91
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -32,9 +32,15 @@ check_nc() {
}
check_yq() {
# shellcheck disable=SC2016
howto_install='You can install it with your favorite package manager (including snap) or with "GO111MODULE=on go get github.com/mikefarah/yq/v4" and add ~/go/bin to $PATH.'
if ! command -v yq >/dev/null; then
die "missing required program 'yq'. You can install it with 'GO111MODULE=on go get github.com/mikefarah/yq/v4' and add ~/go/bin to $PATH"
die "Missing required program 'yq'. $howto_install"
fi
if ! (yq --version | grep mikefarah >/dev/null); then
die "yq exists but it's not the one we need (mikefarah/yq). $howto_install"
fi
}
check_daemonizer() {