Skip to content

Commit

Permalink
feat(cmd/install_bin): Add func InstallBinForExternalGoUse
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejsika committed Apr 29, 2023
1 parent 1fb438e commit 6073809
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions cmd/install_bin/external.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package install_bin

func InstallBinForExternalGoUse(name string, os string, arch string, binDir string) {
for _, tool := range Tools {
if tool.Name != name {
continue
}

getOsFunc := func(x string) string { return x }
if tool.GetOsFunc != nil {
getOsFunc = tool.GetOsFunc
}

getArchFunc := func(x string) string { return x }
if tool.GetArchFunc != nil {
getArchFunc = tool.GetArchFunc
}

run(
tool.Name,
tool.Aliases,
tool.SourcePath,
tool.UrlTemplate,
tool.GetVersionFunc,
getUrl,
getSourcePath,
getOsFunc,
getArchFunc,
func() string { return os },
func() string { return arch },
func() string { return binDir },
)
}
}

0 comments on commit 6073809

Please sign in to comment.