From 4bd5764c4e469536db90c5a7ad1f3cef85668b13 Mon Sep 17 00:00:00 2001 From: Skyxim Date: Tue, 25 Jan 2022 21:47:11 +0800 Subject: [PATCH] Update Makefile --- Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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)/*