Skip to content

Commit

Permalink
Fix download command with Apple Silicon machines
Browse files Browse the repository at this point in the history
Signed-off-by: Zespre Schmidt <starbops@zespre.com>
  • Loading branch information
starbops authored and alexellis committed Feb 1, 2023
1 parent 314a9bb commit 29f896b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,11 @@ func buildFilename(arch, osVal string) (string, string) {
}

if osVal == "darwin" {
arch = "-" + osVal
if arch == "arm64" {
arch = "-" + osVal + "-" + arch
} else {
arch = "-" + osVal
}
} else if arch == "amd64" {
arch = ""
} else {
Expand Down
9 changes: 9 additions & 0 deletions cmd/download_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,12 @@ func Test_BuildFilename_Darwin_amd64(t *testing.T) {
t.Errorf("want: %s, but got: %s", want, arch+ext)
}
}

func Test_BuildFilename_Darwin_arm64(t *testing.T) {
arch, ext := buildFilename("arm64", "darwin")
want := "-darwin-arm64"

if want != arch+ext {
t.Errorf("want: %s, but got: %s", want, arch+ext)
}
}

0 comments on commit 29f896b

Please sign in to comment.