Skip to content

Commit 6df578b

Browse files
committed
test
1 parent ef11dba commit 6df578b

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

pkg/cmd/version.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ var versionCmd = &cobra.Command{
1414
}
1515

1616
func 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
}

pkg/version/version.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
package version
22

3+
import (
4+
"fmt"
5+
"runtime/debug"
6+
)
7+
38
// Version of renku-dev-utils
49
var 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+
}

0 commit comments

Comments
 (0)