Conversation
|
Thanks for adding this, I have been hoping this will land. Two questions:
Idea: add in a link to the release notes like |
It doesn't work right now, and maybe we could make it work (not sure if our CLI framework enables that), but I don't feel like it's strictly needed. Because sometimes
That's a good point! Our CLI framework ensures that it's already there: |
| # export GOFLAGS := -mod=vendor $GOFLAGS | ||
| GH_VERSION = $(shell go describe --tags 2>/dev/null || git rev-parse --short HEAD) | ||
| LDFLAGS := -X github.com/github/gh-cli/command.Version=$(GH_VERSION) $(LDFLAGS) | ||
| LDFLAGS := -X github.com/github/gh-cli/command.BuildDate=$(shell date +%Y-%m-%d) $(LDFLAGS) |
There was a problem hiding this comment.
Woah, this linker trick is super cool and handy!
command/root.go
Outdated
| // Version is dynamically set at build time | ||
| var Version = "DEV" | ||
|
|
||
| // BuildDate is dynamically set at build time |
There was a problem hiding this comment.
It might make sense to say where the dynamic part happens, like "BuildDate is dynamically set at build time in the Makefile"
Refactored output, the tests, and the use of opts in runBrowse

gh --version=> "gh version VERSION (DATE)"