Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Npm: download the required binaries during installation #188

Merged
merged 17 commits into from
Jun 2, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
lint: gofmt and golint
  • Loading branch information
aminya committed May 19, 2021
commit 743fde3f75f82c31708b59ff8223cac4e65e3bba
11 changes: 5 additions & 6 deletions cmd/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package cmd
import (
"bytes"
"embed"
"text/template"
"runtime"
"text/template"

"github.com/spf13/afero"
)
Expand All @@ -15,7 +15,7 @@ var templatesFS embed.FS
type hookTmplData struct {
AutoInstall string
HookName string
Extension string
Extension string
}

func hookTemplate(hookName string, fs afero.Fs) []byte {
Expand All @@ -24,7 +24,7 @@ func hookTemplate(hookName string, fs afero.Fs) []byte {
err := t.Execute(buf, hookTmplData{
AutoInstall: autoInstall(hookName, fs),
HookName: hookName,
Extension: getExtension(),
Extension: getExtension(),
})
check(err)

Expand All @@ -47,9 +47,8 @@ func autoInstall(hookName string, fs afero.Fs) string {
}

func getExtension() string {
if (runtime.GOOS == "windows") {
if runtime.GOOS == "windows" {
return ".exe"
} else {
return ""
}
return ""
}