Browse code

Implementing dirty git checkout indicator

Shawn Siefkas authored on 2013/04/02 23:38:08
Showing 1 changed files
... ...
@@ -10,7 +10,10 @@ ifeq ($(VERBOSE), 1)
10 10
 GO_OPTIONS += -v
11 11
 endif
12 12
 
13
-BUILD_OPTIONS = -ldflags "-X main.GIT_COMMIT `git rev-parse --short HEAD`"
13
+GIT_COMMIT = $(shell git rev-parse --short HEAD)
14
+GIT_STATUS = $(shell test -n "`git status --porcelain`" && echo "+CHANGES")
15
+
16
+BUILD_OPTIONS = -ldflags "-X main.GIT_COMMIT $(GIT_COMMIT)$(GIT_STATUS)"
14 17
 
15 18
 SRC_DIR := $(GOPATH)/src
16 19