Skip to content

Commit 29f896b

Browse files
starbopsalexellis
authored andcommitted
Fix download command with Apple Silicon machines
Signed-off-by: Zespre Schmidt <starbops@zespre.com>
1 parent 314a9bb commit 29f896b

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

cmd/download.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,11 @@ func buildFilename(arch, osVal string) (string, string) {
226226
}
227227

228228
if osVal == "darwin" {
229-
arch = "-" + osVal
229+
if arch == "arm64" {
230+
arch = "-" + osVal + "-" + arch
231+
} else {
232+
arch = "-" + osVal
233+
}
230234
} else if arch == "amd64" {
231235
arch = ""
232236
} else {

cmd/download_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,12 @@ func Test_BuildFilename_Darwin_amd64(t *testing.T) {
4646
t.Errorf("want: %s, but got: %s", want, arch+ext)
4747
}
4848
}
49+
50+
func Test_BuildFilename_Darwin_arm64(t *testing.T) {
51+
arch, ext := buildFilename("arm64", "darwin")
52+
want := "-darwin-arm64"
53+
54+
if want != arch+ext {
55+
t.Errorf("want: %s, but got: %s", want, arch+ext)
56+
}
57+
}

0 commit comments

Comments
 (0)