Skip to content

Commit f3665d2

Browse files
authored
fix(Makefile): use string value checks instead of ifndef (#9226)
a variable can be defined, and still have an empty string value.
1 parent 8fc3e4e commit f3665d2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ dir ?= $(shell pwd)
1515

1616
# GOOGLE_SAMPLES_PROJECT takes precedence over GOOGLE_CLOUD_PROJECT
1717
PROJECT_ID = ${GOOGLE_SAMPLES_PROJECT}
18-
PROJECT_ID ?= ${GOOGLE_CLOUD_PROJECT}
18+
19+
ifeq ("${PROJECT_ID}", "")
20+
PROJECT_ID = ${GOOGLE_CLOUD_PROJECT}
21+
endif
22+
1923
# export our project ID as GOOGLE_CLOUD_PROJECT in the action environment
2024
override GOOGLE_CLOUD_PROJECT := ${PROJECT_ID}
2125
export GOOGLE_CLOUD_PROJECT
@@ -38,7 +42,7 @@ lint:
3842
mvn -P lint checkstyle:check
3943

4044
check-env:
41-
ifndef PROJECT_ID
45+
ifeq ("${PROJECT_ID}", "")
4246
$(error At least one of the following env vars must be set: GOOGLE_SAMPLES_PROJECT, GOOGLE_CLOUD_PROJECT.)
4347
endif
4448

0 commit comments

Comments
 (0)