Include go version into builds
This commit is contained in:
@@ -143,12 +143,14 @@ func initOptions() {
|
||||
}
|
||||
|
||||
func printVersion() {
|
||||
str := fmt.Sprintf("Pgweb v%s", command.Version)
|
||||
chunks := []string{fmt.Sprintf("Pgweb v%s", command.Version)}
|
||||
if command.GitCommit != "" {
|
||||
str += fmt.Sprintf(" (git: %s)", command.GitCommit)
|
||||
chunks = append(chunks, fmt.Sprintf("(git: %s)", command.GitCommit))
|
||||
}
|
||||
|
||||
fmt.Println(str)
|
||||
if command.GoVersion != "" {
|
||||
chunks = append(chunks, fmt.Sprintf("(go: %s)", command.GoVersion))
|
||||
}
|
||||
fmt.Println(strings.Join(chunks, " "))
|
||||
}
|
||||
|
||||
func startServer() {
|
||||
|
||||
@@ -1,10 +1,17 @@
|
||||
package command
|
||||
|
||||
const (
|
||||
// Version is the current Pgweb application version
|
||||
Version = "0.11.4"
|
||||
)
|
||||
|
||||
var (
|
||||
// GitCommit contains the Git commit SHA for the binary
|
||||
GitCommit string
|
||||
|
||||
// BuildTime contains the binary build time
|
||||
BuildTime string
|
||||
|
||||
// GoVersion contains the Go runtime version
|
||||
GoVersion string
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user