From 9eae9ac75f95cf88e263c1d1517dcb243a0acda2 Mon Sep 17 00:00:00 2001 From: Gwyn Date: Thu, 3 Nov 2022 05:57:04 -0600 Subject: [PATCH] Updates Makefile so shellcheck is cross-platform. (#1946) Specifically, it was always downloading the linux version no matter the platform. So I moved the OS detection to be early in the makefile and verified that I can now download the darwin version of shellcheck. --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 0314858a..a3ac7fc7 100644 --- a/Makefile +++ b/Makefile @@ -34,6 +34,8 @@ endif TEST_ASSETS=$(PWD)/test-assets TOOLS_PATH=$(PWD)/.tools +OS_NAME := $(shell uname -s | tr A-Z a-z) + # default list of platforms for which multiarch image is built ifeq (${PLATFORMS}, ) export PLATFORMS="linux/amd64,linux/arm64" @@ -267,8 +269,8 @@ ifeq (, $(wildcard $(TOOLS_PATH)/shellcheck)) set -e ;\ SHELLCHECK_TMP_DIR=$$(mktemp -d) ;\ cd $$SHELLCHECK_TMP_DIR ;\ - curl -LO https://github.com/koalaman/shellcheck/releases/download/v$(SHELLCHECK_VERSION)/shellcheck-v$(SHELLCHECK_VERSION).linux.x86_64.tar.xz ;\ - tar Jxvf shellcheck-v$(SHELLCHECK_VERSION).linux.x86_64.tar.xz ;\ + curl -LO https://github.com/koalaman/shellcheck/releases/download/v$(SHELLCHECK_VERSION)/shellcheck-v$(SHELLCHECK_VERSION).$(OS_NAME).x86_64.tar.xz ;\ + tar Jxvf shellcheck-v$(SHELLCHECK_VERSION).$(OS_NAME).x86_64.tar.xz ;\ cd $(CURDIR) ;\ mkdir -p $(TOOLS_PATH) ;\ mv $$SHELLCHECK_TMP_DIR/shellcheck-v$(SHELLCHECK_VERSION)/shellcheck $(TOOLS_PATH)/ ;\ @@ -277,8 +279,6 @@ ifeq (, $(wildcard $(TOOLS_PATH)/shellcheck)) endif SHELLCHECK=$(TOOLS_PATH)/shellcheck -OS_NAME := $(shell uname -s | tr A-Z a-z) - # find or download etcd etcd: ifeq (, $(shell which etcd))