refactor(version): extract version formatting helpers and improve build info display
Extract formatVersion() and formatBuildInfo() helper functions to reduce code duplication between printVersion() and statusCmd(). Update git commit default value to "dev" in Makefile for consistency with version handling. Update documentation for QQ and DingTalk chat integration in Japanese README.
This commit is contained in:
2
Makefile
2
Makefile
@@ -8,7 +8,7 @@ MAIN_GO=$(CMD_DIR)/main.go
|
||||
|
||||
# Version
|
||||
VERSION?=$(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
|
||||
GIT_COMMIT=$(shell git rev-parse --short=8 HEAD 2>/dev/null || echo "unknown")
|
||||
GIT_COMMIT=$(shell git rev-parse --short=8 HEAD 2>/dev/null || echo "dev")
|
||||
BUILD_TIME=$(shell date +%FT%T%z)
|
||||
GO_VERSION=$(shell $(GO) version | awk '{print $$3}')
|
||||
LDFLAGS=-ldflags "-X main.version=$(VERSION) -X main.gitCommit=$(GIT_COMMIT) -X main.buildTime=$(BUILD_TIME) -X main.goVersion=$(GO_VERSION)"
|
||||
|
||||
Reference in New Issue
Block a user