From b09339ae917df38b3f3c03a50b3d85e77ab7badd Mon Sep 17 00:00:00 2001 From: mmetc <92726601+mmetc@users.noreply.github.com> Date: Tue, 15 Mar 2022 15:03:56 +0100 Subject: [PATCH] bats: check for yq version (#1355) --- tests/check-requirements | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/check-requirements b/tests/check-requirements index 73772c807..40e619fcf 100755 --- a/tests/check-requirements +++ b/tests/check-requirements @@ -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() {