mirror of
https://github.com/kovetskiy/mark.git
synced 2026-05-03 05:42:35 +00:00
Get version from ldflags
This commit is contained in:
4
Makefile
4
Makefile
@@ -1,7 +1,7 @@
|
||||
NAME = $(notdir $(PWD))
|
||||
|
||||
VERSION = $(shell git describe --tags --abbrev=0)
|
||||
|
||||
COMMIT = $(shell git rev-parse HEAD)
|
||||
GO111MODULE = on
|
||||
|
||||
REMOTE = kovetskiy
|
||||
@@ -15,7 +15,7 @@ get:
|
||||
build:
|
||||
@echo :: building go binary $(VERSION)
|
||||
CGO_ENABLED=0 go build \
|
||||
-ldflags "-X main.version=$(VERSION)" \
|
||||
-ldflags "-X main.version=$(VERSION) -X main.commit=$(COMMIT)" \
|
||||
-gcflags "-trimpath $(GOPATH)/src"
|
||||
|
||||
test:
|
||||
|
||||
Reference in New Issue
Block a user