warrensbox/terraform-switcher

Version flag is not displaying the correct version

Closed this issue · 4 comments

With the change of the release version tagging, the --version flag is no longer displaying the correct version.

It is still fixed on the string defined in the https://github.com/warrensbox/terraform-switcher/blob/master/main.go#L51
Could we possibly modify a version.go file prior to compilation with the new tag @warrensbox ?

That version bit in the code was bugging me as well =)

JFYI: The released binaries get correct version injected during the build by Goreleaser (https://github.com/warrensbox/terraform-switcher/blob/master/.goreleaser.yml#L7). Though, I agree that we probably need to implement fallback inside the code so that manually built binaries are tagged with e.g. latest commit hash in the branch. Else we need to bump https://github.com/warrensbox/terraform-switcher/blob/master/main.go#L51 on every release 🤔

That version bit in the code was bugging me as well =)

JFYI: The released binaries get correct version injected during the build by Goreleaser (https://github.com/warrensbox/terraform-switcher/blob/master/.goreleaser.yml#L7). Though, I agree that we probably need to implement fallback inside the code so that manually built binaries are tagged with e.g. latest commit hash in the branch. Else we need to bump https://github.com/warrensbox/terraform-switcher/blob/master/main.go#L51 on every release 🤔

This cannot work as the variable must no be initialized to be set during th ebuild process.
See https://stackoverflow.com/questions/11354518/application-auto-build-versioning

This cannot work as the variable must no be initialized to be set during th ebuild process.

Well... but this works somehow.
Either way I'm all for #374 👍🏻

I think this was done initially to debug the code during local build. It may not be useful anymore.