Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flag for reading binary version #57

Open
blacksails opened this issue Nov 22, 2023 · 0 comments · Fixed by #78
Open

Add flag for reading binary version #57

blacksails opened this issue Nov 22, 2023 · 0 comments · Fixed by #78
Labels
enhancement New feature or request

Comments

@blacksails
Copy link

It would be nice to be able to get the version of the binary through a flag eg. crd-ref-docs --version. We rely on doing this in order to ensure that our team uses the right versions of binaries. We would like to be able to do something like this in our Makefile:

CRD_REF_DOCS ?= $(TOOLSBIN)/crd-ref-docs
CRD_REF_DOCS_GO_MOD_VERSION ?= $(shell cat tools/go.mod | grep -E "github.com/elastic/crd-ref-docs" | cut -d ' ' -f2)

.PHONY: crd-ref-docs
crd-ref-docs: ## 📦 Download crd-ref-docs locally if necessary.
	(test -s $(CRD_REF_DOCS) && \
	$(CRD_REF_DOCS) --version | grep $(CRD_REF_DOCS_GO_MOD_VERSION)) || \
	(cd tools && GOBIN=$(TOOLSBIN) go install github.com/elastic/crd-ref-docs)

This make target will download the binary and install it in ./tools/bin if it doesn't exist or the version doesn't match what we have in the go module in ./tools/go.mod.

@thbkrkr thbkrkr added the enhancement New feature or request label Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants