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

Use regex for release asset download #50

Closed coryvirok closed 5 years ago

coryvirok commented 5 years ago

~Caveat: The checksum functionality for verifying release assets still only supports 1 asset. If multiple assets match the regex provided, an error will be returned.~

Multiple checksums can now be passed via the command line and the downloaded assets must match one of them.

coryvirok commented 5 years ago

Thanks for the feedback, @yorinasub17 and @josh-padnick. I appreciate the code review and nits since I'm very new to Golang development. Please let me know if I've missed anything.

To answer your question regarding the motivation for this change:

I was looking for a tool that would allow me to easily download assets uploaded to a GitHub release using a personal auth token. I found your tool and liked it, however the assets uploaded to the releases I'm interested in have version numbers in their names, e.g. "foo-1.2.3-linux_amd64". This made it difficult to download the "latest version" of the release asset since it would require that I provide the version number in the requested asset name. So, I figured it was easier and more productive to modify your tool than write my own unmaintainable bash scripts. I also saw a similar issue opened and someone mentioned that you'd accept PRs for this functionality. (https://github.com/gruntwork-io/fetch/issues/29) So, hopefully this helps out those folks too.

yorinasub17 commented 5 years ago

@coryvirok Ok I think this is ready to merge with your latest changes. I am going to go ahead and merge this in, and let our builds run. If it passes I'll cut a new release. Thanks for your contribution!

yorinasub17 commented 5 years ago

https://github.com/gruntwork-io/fetch/releases/tag/v0.3.3

coryvirok commented 5 years ago

Fantastic, thanks!