Skip to content

Commit

Permalink
added additional variables to show user their version and info about …
Browse files Browse the repository at this point in the history
…it if needed.
  • Loading branch information
ehearneRedHat committed Jun 10, 2024
1 parent fe14ab3 commit a4219ad
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@ limitations under the License.
package version

var (
// This variable is dependent on what the current release is e.g. if it is v0.2.3 then this variable, outside of releases, will be v0.2.4-dev .
// This variable shows the user any additional changes to files made that aren't on the branch.
GitDirty string
// This variable shows the commit hash of the repo so they can confirm they are on latest or specific version of the branch.
GitHash string
// This variable is dependent on what the current release is e.g. if it is v0.2.3 then this variable, outside of releases, will be v0.2.4-dev .
Version = "v0.2.4-dev"
)

func init() {
if GitDirty != "" && GitHash != "" {
Version += " (" + GitHash + " - " + GitDirty + ")"
} else if GitDirty == "" {
Version += " (" + GitHash + ")"
}
}

0 comments on commit a4219ad

Please sign in to comment.