This is an automated email from the ASF dual-hosted git repository.

lynwee pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/main by this push:
     new 8949c4f79 fix: version tag (#8083)
8949c4f79 is described below

commit 8949c4f794bcf6c312443d5a6e58f827c6cec010
Author: abeizn <[email protected]>
AuthorDate: Fri Sep 20 18:53:09 2024 +0800

    fix: version tag (#8083)
    
    * fix: version tag
    
    * fix: version tag
    
    * fix: version tag
---
 Makefile         | 4 ++--
 backend/Makefile | 5 ++---
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index 9417f6505..80197be9e 100644
--- a/Makefile
+++ b/Makefile
@@ -17,8 +17,8 @@
 # https://stackoverflow.com/questions/920413/make-error-missing-separator
 # https://tutorialedge.net/golang/makefiles-for-go-developers/
 
-SHA := $(shell if [ -d .git ]; then git show -s --format=%h; else echo 
"default_SHA"; fi)
-TAG := $(shell if [ -d .git ]; then git tag --points-at HEAD; else echo 
"default_TAG"; fi)
+SHA ?= $(shell git show -s --format=%h 2>/dev/null || echo "default_SHA")
+TAG ?= $(shell git tag --points-at HEAD 2>/dev/null || echo "default_TAG")
 IMAGE_REPO ?= "apache"
 VERSION = $(TAG)@$(SHA)
 
diff --git a/backend/Makefile b/backend/Makefile
index bb321473c..554ecfe20 100644
--- a/backend/Makefile
+++ b/backend/Makefile
@@ -17,13 +17,12 @@
 # https://stackoverflow.com/questions/920413/make-error-missing-separator
 # https://tutorialedge.net/golang/makefiles-for-go-developers/
 
-SHA := $(shell if [ -d .git ]; then git show -s --format=%h; else echo 
"default_SHA"; fi)
-TAG := $(shell if [ -d .git ]; then git tag --points-at HEAD; else echo 
"default_TAG"; fi)
+SHA ?= $(shell git show -s --format=%h 2>/dev/null || echo "default_SHA")
+TAG ?= $(shell git tag --points-at HEAD 2>/dev/null || echo "default_TAG")
 IMAGE_REPO ?= "apache"
 VERSION = $(TAG)@$(SHA)
 PYTHON_DIR ?= "./python"
 
-
 all: build
 
 go-dep:

Reply via email to