Skip to content

Commit 097a824

Browse files
committed
Update bump-agent-version to use gsed
This means that we can use the same sed invocation on both macos and linux, but macos users will have to `brew install gsed`
1 parent d593f59 commit 097a824

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Makefile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,15 @@ update-stack: build/aws-stack.yml env-STACK_NAME
204204

205205
AGENT_VERSION ?= $(shell curl -Lfs "https://buildkite.com/agent/releases/latest?platform=linux&arch=amd64" | grep version | cut -d= -f2)
206206

207+
SED ?= sed
208+
ifeq ($(shell uname), Darwin)
209+
SED = gsed
210+
endif
211+
207212
bump-agent-version:
208-
sed -Ei "s/\[Buildkite Agent v.*\]/[Buildkite Agent v$(AGENT_VERSION)]/g" README.md
209-
sed -Ei "s/AGENT_VERSION=.+/AGENT_VERSION=$(AGENT_VERSION)/g" packer/linux/scripts/install-buildkite-agent.sh
210-
sed -Ei "s/\\\$$AGENT_VERSION = \".+\"/\$$AGENT_VERSION = \"$(AGENT_VERSION)\"/g" packer/windows/scripts/install-buildkite-agent.ps1
213+
$(SED) -Ei "s/\[Buildkite Agent v.*\]/[Buildkite Agent v$(AGENT_VERSION)]/g" README.md
214+
$(SED) -Ei "s/AGENT_VERSION=.+/AGENT_VERSION=$(AGENT_VERSION)/g" packer/linux/scripts/install-buildkite-agent.sh
215+
$(SED) -Ei "s/\\\$$AGENT_VERSION = \".+\"/\$$AGENT_VERSION = \"$(AGENT_VERSION)\"/g" packer/windows/scripts/install-buildkite-agent.ps1
211216

212217
validate: build/aws-stack.yml
213218
aws --no-cli-pager cloudformation validate-template \

0 commit comments

Comments
 (0)