Added check for git tag in version building

This commit is contained in:
Trial97
2020-02-11 08:26:25 +02:00
committed by Dan Christian Bogos
parent 191335c2d6
commit 8f446b033d
2 changed files with 7 additions and 1 deletions

View File

@@ -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

View File

@@ -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
}