From fd864d9a2a51e8620e17f74f4507ca3dedae2676 Mon Sep 17 00:00:00 2001 From: Sam Dowell Date: Thu, 14 Sep 2023 16:53:30 -0700 Subject: [PATCH] fix: explicitly set makefile shell to bash (#881) Some of our make targets use bash syntax, which requires for the shell used by make to be bash. Make uses sh by default, so the shell should be set explicitly here. This was a gotcha before, because some systems replace sh with bash. Explicitly setting the shell should help avoid future gotchas. --- Makefile | 3 +++ Makefile.build | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c74bd3a07d..e6f768f3e0 100644 --- a/Makefile +++ b/Makefile @@ -20,6 +20,9 @@ REPO := kpt.dev/configsync +# Some of our recipes use bash syntax, so explicitly set the shell to bash. +SHELL := /bin/bash + # List of dirs containing go code owned by Nomos NOMOS_CODE_DIRS := pkg cmd e2e NOMOS_GO_PKG := $(foreach dir,$(NOMOS_CODE_DIRS),./$(dir)/...) diff --git a/Makefile.build b/Makefile.build index 7588b69e69..33515b4aff 100644 --- a/Makefile.build +++ b/Makefile.build @@ -11,7 +11,7 @@ HELM := $(BIN_DIR)/helm # Builds the image if it does not exist to enable testing with a new image # version before publishing. pull-buildenv: - @docker image inspect $(BUILDENV_IMAGE) \ + @docker image inspect $(BUILDENV_IMAGE) &> /dev/null \ || docker pull $(BUILDENV_IMAGE) || $(MAKE) build-buildenv build-buildenv: build/buildenv/Dockerfile