Kaynağa Gözat

Implementing dirty git checkout indicator

Shawn Siefkas 12 yıl önce
ebeveyn
işleme
5471f5b2ee
1 değiştirilmiş dosya ile 4 ekleme ve 1 silme
  1. 4 1
      Makefile

+ 4 - 1
Makefile

@@ -10,7 +10,10 @@ ifeq ($(VERBOSE), 1)
 GO_OPTIONS += -v
 GO_OPTIONS += -v
 endif
 endif
 
 
-BUILD_OPTIONS = -ldflags "-X main.GIT_COMMIT `git rev-parse --short HEAD`"
+GIT_COMMIT = $(shell git rev-parse --short HEAD)
+GIT_STATUS = $(shell test -n "`git status --porcelain`" && echo "+CHANGES")
+
+BUILD_OPTIONS = -ldflags "-X main.GIT_COMMIT $(GIT_COMMIT)$(GIT_STATUS)"
 
 
 SRC_DIR := $(GOPATH)/src
 SRC_DIR := $(GOPATH)/src