Skip to content

Commit 3a01992

Browse files
committed
Output gsed missing error when not installed
1 parent 53f3656 commit 3a01992

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ build/aws-stack.yml:
7474
} else { \
7575
print \
7676
}\
77-
}' templates/aws-stack.yml | sed "s/%v/$(VERSION)/" > $@
77+
}' templates/aws-stack.yml | $(SED) "s/%v/$(VERSION)/" > $@
7878

7979
# -----------------------------------------
8080
# AMI creation with Packer
@@ -235,9 +235,12 @@ AGENT_VERSION ?= $(shell curl -Lfs "https://buildkite.com/agent/releases/latest?
235235

236236
SED ?= sed
237237
ifeq ($(shell uname), Darwin)
238-
# Use GNU sed, not MacOS sed
239-
# Install with: brew install gsed
238+
# Use GNU sed, not MacOS sed - required for extended regex support
239+
# BSD sed (default on macOS) doesn't support the regex patterns used in this Makefile
240240
SED = gsed
241+
ifeq ($(shell command -v gsed >/dev/null 2>&1 && echo yes || echo no), no)
242+
$(error GNU sed (gsed) is required on macOS but not found. Please install with: brew install gnu-sed)
243+
endif
241244
endif
242245

243246
bump-agent-version:

0 commit comments

Comments
 (0)