Adding git commit to the version output

The Makefile must be used in order to inject the git commit
via -ldflags.
This commit is contained in:
Shawn Siefkas
2013-04-01 13:52:45 -05:00
parent 1d6929c8bc
commit 37a78902db
3 changed files with 9 additions and 1 deletions
+3
View File
@@ -10,6 +10,8 @@ import (
"os"
)
var GIT_COMMIT string
func main() {
if docker.SelfPath() == "/sbin/init" {
// Running in init mode
@@ -21,6 +23,7 @@ func main() {
flDebug := flag.Bool("D", false, "Debug mode")
flag.Parse()
rcli.DEBUG_FLAG = *flDebug
docker.GIT_COMMIT = GIT_COMMIT
if *flDaemon {
if flag.NArg() != 0 {
flag.Usage()