malcontent icon indicating copy to clipboard operation
malcontent copied to clipboard

Add version support

Open egibs opened this issue 1 year ago • 0 comments

Closes: https://github.com/chainguard-dev/bincapz/issues/209

This PR adds support for a --version flag that will either use the newly-added VERSION file or check for the main.version build key.

Testing:

❯ go run . --version
bincapz 0.11.0
❯ go build -ldflags "-X main.version=$(cat VERSION)" && ./bincapz --version
bincapz 0.11.0

We aren't publishing binaries yet but this should work the same if we use the VERSION file as the source of truth; however, this file will need to be updated prior to any new releases being cut.

If there's a better way to handle this I'm all ears!

egibs avatar May 10 '24 14:05 egibs