1
- # Use a single bash shell for each job, and immediately exit on failure
1
+ # Use bash and immediately exit on failure
2
2
SHELL := bash
3
3
.SHELLFLAGS := -ceu
4
- .ONESHELL :
5
4
6
5
# This doesn't work on directories.
7
6
# See https://stackoverflow.com/questions/25752543/make-delete-on-error-for-directory-targets
@@ -14,11 +13,11 @@ ifndef VERBOSE
14
13
endif
15
14
16
15
ifdef 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
19
18
else
20
- LINTFLAGS :=
21
- FMTFLAGS :=
19
+ LINTFLAGS :=
20
+ FMTFLAGS :=
22
21
endif
23
22
24
23
PROJECT := Coder\ Desktop
@@ -27,6 +26,12 @@ SCHEME := Coder\ Desktop
27
26
SWIFT_VERSION := 6.0
28
27
29
28
MUTAGEN_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
30
35
31
36
ifndef CURRENT_PROJECT_VERSION
32
37
CURRENT_PROJECT_VERSION:=$(shell git describe --match 'v[0-9]*' --dirty='.devel' --always --tags)
@@ -56,9 +61,7 @@ setup: \
56
61
57
62
# Mutagen resources
58
63
$(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 " $@ " )"
62
65
echo " Downloading from $$ {url}"
63
66
curl -sL $$ {url} -o " $@ "
64
67
chmod +x " $@ "
0 commit comments