Skip to content

Commit 5b29a42

Browse files
committed
refactor: update code
1 parent 80a49f3 commit 5b29a42

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

go.mod

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ require (
1818
github.com/goreleaser/fileglob v1.4.0
1919
github.com/joho/godotenv v1.5.1
2020
github.com/olekukonko/tablewriter v0.0.5
21-
github.com/onexstack/onexstack v0.3.1-rc.1
21+
github.com/onexstack/onexstack v0.3.1-rc.2
2222
github.com/purpleclay/gitz v0.11.2
2323
github.com/rakyll/statik v0.1.7
2424
github.com/shirou/gopsutil/v3 v3.23.6
@@ -181,3 +181,5 @@ require (
181181
sigs.k8s.io/structured-merge-diff/v4 v4.4.2 // indirect
182182
sigs.k8s.io/yaml v1.4.0 // indirect
183183
)
184+
185+
replace github.com/onexstack/onexstack => /home/colin/workspace/golang/src/github.com/onexstack/onexstack

internal/osbuilder/cmd/version/version.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import (
2121
cmdutil "github.com/onexstack/osbuilder/internal/osbuilder/cmd/util"
2222
)
2323

24+
const currentModule = "github.com/onexstack/osbuilder"
25+
2426
// Version is a struct for version information.
2527
type Version struct {
2628
ClientVersion *version.Info `json:"clientVersion,omitempty" yaml:"clientVersion,omitempty"`
@@ -89,7 +91,10 @@ func (o *Options) Run() error {
8991
versionInfo Version
9092
)
9193

92-
clientVersion := version.GetFromDebugInfo()
94+
clientVersion := version.Get()
95+
if clientVersion.GitVersion == "" {
96+
clientVersion = version.GetFromDebugInfo(currentModule)
97+
}
9398

9499
switch o.Output {
95100
case "":

0 commit comments

Comments
 (0)