Skip to content

Commit

Permalink
Fix gh CLI for Darwin
Browse files Browse the repository at this point in the history
The upstream project renamed the .tar.gz file to .zip for
MacOS/Darwin

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
  • Loading branch information
alexellis committed Sep 13, 2023
1 parent d6eff90 commit b3e4aa0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/get/get_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1439,7 +1439,12 @@ func Test_DownloadGH(t *testing.T) {
{os: "darwin",
arch: arch64bit,
version: toolVersion,
url: `https://github.com/cli/cli/releases/download/v1.6.1/gh_1.6.1_macOS_amd64.tar.gz`,
url: `https://github.com/cli/cli/releases/download/v1.6.1/gh_1.6.1_macOS_amd64.zip`,
},
{os: "darwin",
arch: archARM64,
version: toolVersion,
url: `https://github.com/cli/cli/releases/download/v1.6.1/gh_1.6.1_macOS_arm64.zip`,
},
{os: "linux",
arch: archARM64,
Expand Down
2 changes: 2 additions & 0 deletions pkg/get/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,8 @@ https://releases.hashicorp.com/{{.Name}}/{{.Version}}/{{.Name}}_{{.Version}}_{{$
{{$extStr := "tar.gz"}}
{{ if HasPrefix .OS "ming" -}}
{{$extStr = "zip"}}
{{- else if eq .OS "darwin" -}}
{{$extStr = "zip"}}
{{- end -}}
{{$osStr := ""}}
Expand Down

0 comments on commit b3e4aa0

Please sign in to comment.