Move version definition into command package, include build timestamp, add /api/info endpoint

This commit is contained in:
Dan Sosedoff
2015-05-05 00:34:23 -05:00
parent 0bd5360315
commit c0f3f027ae
6 changed files with 25 additions and 9 deletions

11
main.go
View File

@@ -14,11 +14,6 @@ import (
"github.com/sosedoff/pgweb/pkg/util"
)
const VERSION = "0.5.2"
// The git commit that was compiled. This will be filled in by the compiler.
var GitCommit string
var options command.Options
func exitWithMessage(message string) {
@@ -72,9 +67,9 @@ func initOptions() {
}
func printVersion() {
str := fmt.Sprintf("Pgweb v%s", VERSION)
if GitCommit != "" {
str += fmt.Sprintf(" (git: %s)", GitCommit)
str := fmt.Sprintf("Pgweb v%s", command.VERSION)
if command.GitCommit != "" {
str += fmt.Sprintf(" (git: %s)", command.GitCommit)
}
fmt.Println(str)