Skip to content

Commit

Permalink
fix: [StyraInc#1275] Return version if regal installed using go install
Browse files Browse the repository at this point in the history
  • Loading branch information
sbp-bvanb committed Nov 25, 2024
1 parent 34ba147 commit f902f01
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 1 addition & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
"OPA_CHECK_CAPABILITIES": "${workspacePath}/build/capabilities.json",
"OPA_EVAL_CAPABILITIES": "${workspacePath}/build/capabilities.json"
},
"opa.roots": [
"${workspaceFolder}/bundle"
],
"opa.roots": ["${workspaceFolder}/bundle"],
"opa.strictMode": true
}
10 changes: 9 additions & 1 deletion pkg/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (vi Info) String() string {

func New() Info {
return Info{
Version: unknownString(Version),
Version: unknownVersionString(Version),
GoVersion: goVersion,
Platform: platform,
Commit: unknownString(Commit),
Expand All @@ -67,3 +67,11 @@ func unknownString(s string) string {

return s
}

func unknownVersionString(s string) string {
if s == "" {
return "v.29.3"
}

return s
}

0 comments on commit f902f01

Please sign in to comment.