From 8f446b033d4e341665a6dd52e7d54b36196627b5 Mon Sep 17 00:00:00 2001 From: Trial97 Date: Tue, 11 Feb 2020 08:26:25 +0200 Subject: [PATCH] Added check for git tag in version building --- build.sh | 7 +++++++ utils/coreutils.go | 1 - 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index ce10713e6..5ec824b60 100755 --- a/build.sh +++ b/build.sh @@ -3,6 +3,13 @@ echo "Building CGRateS ..." GIT_LAST_LOG=$(git log -1 | tr -d "'") +GIT_TAG_LOG=$(git tag -l --points-at HEAD) + +if [ ! -z "$GIT_TAG_LOG" ] +then + GIT_LAST_LOG="" +fi + go install -ldflags "-X 'github.com/cgrates/cgrates/utils.GitLastLog=$GIT_LAST_LOG'" github.com/cgrates/cgrates/cmd/cgr-engine cr=$? go install -ldflags "-X 'github.com/cgrates/cgrates/utils.GitLastLog=$GIT_LAST_LOG'" github.com/cgrates/cgrates/cmd/cgr-loader diff --git a/utils/coreutils.go b/utils/coreutils.go index 2f59c2456..1f6511073 100644 --- a/utils/coreutils.go +++ b/utils/coreutils.go @@ -662,7 +662,6 @@ func CapitalizedMessage(errMessage string) (capStr string) { func GetCGRVersion() (vers string, err error) { vers = fmt.Sprintf("%s@%s", CGRateS, VERSION) - // return vers, nil // remove this if the commit is not tagged if GitLastLog == "" { return vers, nil }