diff options
author | Kevin <gitlab@a.ikke.info> | 2021-09-16 17:37:26 +0000 |
---|---|---|
committer | Kevin <gitlab@a.ikke.info> | 2021-09-16 17:37:26 +0000 |
commit | 726945b3921144b77b0ddaf2e34e28e2c34b04de (patch) | |
tree | f1a941d7e1b4bc0ddc6b421884dc8c7161bd58ba | |
parent | 37025e61e570e748613d9a5a57a7ae5de1b45af5 (diff) | |
download | gitlab-shell-726945b3921144b77b0ddaf2e34e28e2c34b04de.tar.gz |
makefile: properly quote '$' in VERSION_STRING
If git is not available or gitlab-shell is not built in a repository, it falls back the VERSION file. That command is not properly escaped and results in the message:
> awk: cmd. line:1: Unexpected token
When you remove the `2>/dev/null`. Escape the '$' characters to solve this.
-rw-r--r-- | Makefile | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1,7 +1,7 @@ .PHONY: validate verify verify_ruby verify_golang test test_ruby test_golang coverage coverage_golang setup _script_install build compile check clean install GO_SOURCES := $(shell find . -name '*.go') -VERSION_STRING := $(shell git describe --match v* 2>/dev/null || awk '$0="v"$0' VERSION 2>/dev/null || echo unknown) +VERSION_STRING := $(shell git describe --match v* 2>/dev/null || awk '$$0="v"$$0' VERSION 2>/dev/null || echo unknown) BUILD_TIME := $(shell date -u +%Y%m%d.%H%M%S) BUILD_TAGS := tracer_static tracer_static_jaeger continuous_profiler_stackdriver GOBUILD_FLAGS := -ldflags "-X main.Version=$(VERSION_STRING) -X main.BuildTime=$(BUILD_TIME)" -tags "$(BUILD_TAGS)" |