Skip to content

Commit 969c89b

Browse files
hashseedevanlucas
authored andcommitted
build: fix Makefile wrt finding node executable
Not all shells set PWD, so use CURDIR instead. `which node` may return the empty string, so guard against that too. Consider: if [ -x `which velociraptor` ] && [ -e `which velociprator` ];\ then echo "run"; else echo "keep calm"; fi; PR-URL: #18040 Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
1 parent 470832f commit 969c89b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ COVTESTS ?= test-cov
1414
GTEST_FILTER ?= "*"
1515
GNUMAKEFLAGS += --no-print-directory
1616
GCOV ?= gcov
17+
PWD = $(CURDIR)
1718

1819
ifdef JOBS
1920
PARALLEL_ARGS = -j $(JOBS)
@@ -640,7 +641,7 @@ out/doc/api/assets/%: doc/api_assets/% out/doc/api/assets
640641
available-node = \
641642
if [ -x $(PWD)/$(NODE) ] && [ -e $(PWD)/$(NODE) ]; then \
642643
$(PWD)/$(NODE) $(1); \
643-
elif [ -x `which node` ] && [ -e `which node` ]; then \
644+
elif [ -x `which node` ] && [ -e `which node` ] && [ `which node` ]; then \
644645
`which node` $(1); \
645646
else \
646647
echo "No available node, cannot run \"node $(1)\""; \

0 commit comments

Comments
 (0)