marcosnils / bin

Effortless binary manager
MIT License
648 stars 45 forks source link

Add support for tag patterns (aka "I'd like to install kustomize using bin") #148

Open larsks opened 1 year ago

larsks commented 1 year ago

I would like to use bin to install the latest version of kustomize. The releases page hosts multiple packages; the kustomize releases are tagged with kustomize/<version>.

I can install a specific version of kustomize by running something like:

bin install github.com/kubernetes-sigs/kustomize/releases/tag/kustomize/v4.5.7

But I don't always know the latest version. I'd like to be able to run:

bin install github.com/kubernetes-sigs/kustomize/releases/tag/kustomize/\*

And have it install the latest release matching that tag.

marcosnils commented 1 year ago

agree that it'd be great to support this. I thinking making it at the URL level will be a bit tricky though. How about something like:

bin install -f ^kustomize.* https://github.com/kubernetes-sigs/kustomize`

-f will act as a filter and will only consider releases where the filter regex matches. Thoughts?

larsks commented 1 year ago

I think that would be a fantastic solution!

Stavrospanakakis commented 1 year ago

@marcosnils -f acts as --force in the install cmd.

What about using -e and --regexp as the filtering flag?

For example:

bin install -e ^kustomize.* https://github.com/kubernetes-sigs/kustomize

or

bin install --regexp ^kustomize.* https://github.com/kubernetes-sigs/kustomize
marcosnils commented 1 year ago

SGTM I realized about this afterwards when starting to implement it. Using -e and --expr sounds like a better flag