diff --git a/.gitignore b/.gitignore index b07ce39..bcf72fb 100644 --- a/.gitignore +++ b/.gitignore @@ -21,7 +21,6 @@ debug.test /config.* /handlers/static.go /handlers/tmpls/tmpls.go -/util/version.go /store/main.db /releases /data \ No newline at end of file diff --git a/util/version.go b/util/version.go new file mode 100644 index 0000000..fc0ddd4 --- /dev/null +++ b/util/version.go @@ -0,0 +1,27 @@ +package util + +// VersionInfo are the information which will be added at build time +// and shown in the frontend under the about tab +var VersionInfo Info + +// Info holds the information which will be added at build time +type Info struct { + NodeJS string `json:"nodeJS"` + Commit string `json:"commit"` + Yarn string `json:"yarn"` + CompilationTime string `json:"compilationTime"` +} + +var ( + ldFlagNodeJS string + ldFlagCommit string + ldFlagYarn string + ldFlagCompilationTime string +) + +func init() { + VersionInfo.NodeJS = ldFlagNodeJS + VersionInfo.Commit = ldFlagCommit + VersionInfo.Yarn = ldFlagYarn + VersionInfo.CompilationTime = ldFlagCompilationTime +}