File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -14,5 +14,6 @@ var versionCmd = &cobra.Command{
1414}
1515
1616func runVersion (cmd * cobra.Command , args []string ) {
17- fmt .Printf ("renku-dev-utils %s\n " , version .Version )
17+ // fmt.Printf("renku-dev-utils %s\n", version.Version)
18+ fmt .Printf ("renku-dev-utils %s\n " , version .BB ())
1819}
Original file line number Diff line number Diff line change 11package version
22
3+ import (
4+ "fmt"
5+ "runtime/debug"
6+ )
7+
38// Version of renku-dev-utils
49var Version string = "DEV"
510
@@ -11,3 +16,15 @@ func init() {
1116 Version = Version + "-" + VersionSuffix
1217 }
1318}
19+
20+ func BB () (version string ) {
21+ bi , ok := debug .ReadBuildInfo ()
22+ if ! ok {
23+ return "unknown"
24+ }
25+ version = bi .Main .Version
26+ for _ , setting := range bi .Settings {
27+ fmt .Printf ("%s: %s\n " , setting .Key , setting .Value )
28+ }
29+ return version
30+ }
You can’t perform that action at this time.
0 commit comments