From 27d37575a89f1d4598029059adf459502d3f46db Mon Sep 17 00:00:00 2001 From: Oleg Zaytsev Date: Thu, 19 Dec 2024 14:20:08 +0100 Subject: [PATCH] make generate-otlp: check that tools are installed Signed-off-by: Oleg Zaytsev --- pkg/distributor/otlp/generate.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/distributor/otlp/generate.sh b/pkg/distributor/otlp/generate.sh index 9dc4473dd8b..d5d20193392 100755 --- a/pkg/distributor/otlp/generate.sh +++ b/pkg/distributor/otlp/generate.sh @@ -3,8 +3,11 @@ set -euo pipefail +command -v gopatch >/dev/null 2>&1 || { echo "Please install gopatch. Run 'go install github.com/uber-go/gopatch@latest' or visit https://github.com/uber-go/gopatch for more info."; exit 1; } +command -v goimports >/dev/null 2>&1 || { echo "Please install goimports. Run 'go install golang.org/x/tools/cmd/goimports@latest' or visit https://pkg.go.dev/golang.org/x/tools/cmd/goimports for more info."; exit 1; } + # Use GNU sed on MacOS falling back to `sed` everywhere else -SED=sed +SED="sed" type gsed >/dev/null 2>&1 && SED=gsed FILES=$(find ../../../vendor/github.com/prometheus/prometheus/storage/remote/otlptranslator/prometheusremotewrite -name '*.go' ! -name timeseries.go ! -name "*_test.go")