From e2f943bb1f7775bac512e158a664978fbfd6cb82 Mon Sep 17 00:00:00 2001 From: abeizn Date: Tue, 3 Sep 2024 16:50:26 +0800 Subject: [PATCH] fix: non-git users can build devlake (#7995) --- Makefile | 4 ++-- backend/Makefile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 48ea72487ee..9417f650530 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 git show -s --format=%h) -TAG ?= $(shell git tag --points-at HEAD) +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) IMAGE_REPO ?= "apache" VERSION = $(TAG)@$(SHA) diff --git a/backend/Makefile b/backend/Makefile index 30807416cb3..bb321473c38 100644 --- a/backend/Makefile +++ b/backend/Makefile @@ -17,8 +17,8 @@ # https://stackoverflow.com/questions/920413/make-error-missing-separator # https://tutorialedge.net/golang/makefiles-for-go-developers/ -SHA ?= $(shell git show -s --format=%h) -TAG ?= $(shell git tag --points-at HEAD) +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) IMAGE_REPO ?= "apache" VERSION = $(TAG)@$(SHA) PYTHON_DIR ?= "./python"