You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you install the git-chglog with go install, then these ldflags are not taken into account due to how the release process is set up and how version variable is defined. You'll need to do something like this:
go install -ldflags "-X main.version=1.2.3" github.com/git-chglog/git-chglog/cmd/git-chglog@latest
❯ git-chglog --version
git-chglog version 1.2.3
Using any other installation methods mentioned in README.md will rely on binaries built by GoReleaser that sets main.version ldflag by default. For example:
❯ curl -Lo git-chlog.tar.gz https://github.com/git-chglog/git-chglog/releases/download/v0.15.4/git-chglog_0.15.4_darwin_arm64.tar.gz && tar -xzvf git-chlog.tar.gz
❯ ./git-chglog --version
git-chglog version 0.15.4
I have worked around this in several ways in my own projects, most often by using a build script to generate a go file with version constants and updating that as part of my release process so that the source code always includes a version number and the go install pattern will work without requiring the client to juggle ldflags
When running git-chglog (or git chglog)
--version
or-v
, chglog generates a changelog instead of showing the current version.Expected Behavior
version of chglog and exit -- no generated content.
Actual Behavior
generated content and no version
Steps to Reproduce (including precondition)
git-chglog --version
git-chglog -v
Screenshot on This Problem (if possible)
not reasonable
Your Environment
The text was updated successfully, but these errors were encountered: