2019-11-10 03:36:53 -05:00
|
|
|
package d2common
|
2019-11-02 16:15:16 -04:00
|
|
|
|
2019-11-10 08:51:02 -05:00
|
|
|
// BuildInfoRecord is the structure used to hold information about the current build
|
2019-11-02 16:15:16 -04:00
|
|
|
type BuildInfoRecord struct {
|
2019-11-10 08:51:02 -05:00
|
|
|
// Branch is the branch this build is based on (or 'Local' if built locally)
|
2019-11-02 16:15:16 -04:00
|
|
|
Branch string
|
2019-11-10 08:51:02 -05:00
|
|
|
// Commit is the commit hash of the build (or blank if built locally)
|
2019-11-02 16:15:16 -04:00
|
|
|
Commit string
|
|
|
|
}
|
|
|
|
|
2019-11-10 08:51:02 -05:00
|
|
|
// BuildInfo contains information about the build currently being ran
|
2019-11-02 16:15:16 -04:00
|
|
|
var BuildInfo BuildInfoRecord
|
|
|
|
|
2019-11-10 08:51:02 -05:00
|
|
|
// SetBuildInfo is called at the start of the application to generate the global BuildInfo value
|
2019-11-02 16:15:16 -04:00
|
|
|
func SetBuildInfo(branch, commit string) {
|
|
|
|
BuildInfo = BuildInfoRecord{
|
|
|
|
Branch: branch,
|
|
|
|
Commit: commit,
|
|
|
|
}
|
|
|
|
}
|