gruntwork-io / fetch

Download files, folders, and release assets from a specific git commit, branch, or tag of public and private GitHub repos.
https://www.gruntwork.io/
MIT License
589 stars 90 forks source link

Feature: port architecture and OS introspection support from gruntwork-install #47

Open yorinasub17 opened 5 years ago

yorinasub17 commented 5 years ago

gruntwork-install has the ability to introspect the OS and architecture of the system to determine which binary asset to install.

I can see why this is not in fetch, which is more generic and thus cannot rely on our naming conventions, but it would be nice if that functionality was baked into fetch itself. The primary use case for this would be Windows support. gruntwork-install is implemented in bash, which means it can't be used in most Windows environments. It would be nice if we can port that functionality into fetch, so that we can support Windows too.

Notes:

brikis98 commented 5 years ago

This seems like a good idea.

Perhaps we could expose a --name-template option that is a Go template with a default of:

{{ .BinaryName }}_{{  .OsName }}_{{ .ArchName }}

The default will work for many use cases, but when necessary, users can override that with any Go template syntax of their choice and fetch will fill in those variables.