1- # Use a single bash shell for each job, and immediately exit on failure
1+ # Use bash and immediately exit on failure
22SHELL := bash
33.SHELLFLAGS := -ceu
4- .ONESHELL :
54
65# This doesn't work on directories.
76# See https://stackoverflow.com/questions/25752543/make-delete-on-error-for-directory-targets
@@ -14,11 +13,11 @@ ifndef VERBOSE
1413endif
1514
1615ifdef CI
17- LINTFLAGS := --reporter github-actions-logging
18- FMTFLAGS := --lint --reporter github-actions-log
16+ LINTFLAGS := --reporter github-actions-logging
17+ FMTFLAGS := --lint --reporter github-actions-log
1918else
20- LINTFLAGS :=
21- FMTFLAGS :=
19+ LINTFLAGS :=
20+ FMTFLAGS :=
2221endif
2322
2423PROJECT := Coder\ Desktop
@@ -27,6 +26,12 @@ SCHEME := Coder\ Desktop
2726SWIFT_VERSION := 6.0
2827
2928MUTAGEN_RESOURCES := mutagen-agents.tar.gz mutagen-darwin-arm64 mutagen-darwin-amd64
29+ ifndef MUTAGEN_VERSION
30+ MUTAGEN_VERSION:=$(shell grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$$' $(PROJECT)/Resources/.mutagenversion)
31+ endif
32+ ifeq ($(strip $(MUTAGEN_VERSION ) ) ,)
33+ $(error MUTAGEN_VERSION must be a valid version)
34+ endif
3035
3136ifndef CURRENT_PROJECT_VERSION
3237 CURRENT_PROJECT_VERSION:=$(shell git describe --match 'v[0-9]*' --dirty='.devel' --always --tags)
@@ -56,9 +61,7 @@ setup: \
5661
5762# Mutagen resources
5863$(addprefix $(PROJECT ) /Resources/,$(MUTAGEN_RESOURCES ) ) : $(PROJECT ) /Resources/.mutagenversion
59- version=$$(printf "%s" "$$(cat "$< " ) " )
60- filename=$$(basename "$@ ")
61- url=" https://storage.googleapis.com/coder-desktop/mutagen/$$ {version}/$$ {filename}"
64+ url=" https://storage.googleapis.com/coder-desktop/mutagen/$( MUTAGEN_VERSION) /$$ (basename " $@ " )"
6265 echo " Downloading from $$ {url}"
6366 curl -sL $$ {url} -o " $@ "
6467 chmod +x " $@ "
0 commit comments