diff --git a/Makefile b/Makefile index 82c1f89c..14e234f2 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,10 @@ NAME=Clash.Meta BINDIR=bin -VERSION=$(shell git describe --tags || echo "unknown version") +BRANCH=$(shell git rev-parse --abbrev-ref HEAD) +VERSION=$(shell git describe --tags || echo "unknown version" ) +ifeq ($(BRANCH),Dev) +VERSION=$(shell git rev-parse --short HEAD) +endif BUILDTIME=$(shell date -u) AUTOIPTABLES=Enable GOBUILD=CGO_ENABLED=0 go build -trimpath -ldflags '-X "github.com/Dreamacro/clash/constant.Version=$(VERSION)" \ @@ -145,4 +149,4 @@ all-arch: $(PLATFORM_LIST) $(WINDOWS_ARCH_LIST) releases: $(gz_releases) $(zip_releases) clean: - rm $(BINDIR)/* \ No newline at end of file + rm $(BINDIR)/*