Skip to content

Commit 58255e7

Browse files
aduh95richardlau
authored andcommitted
build: respect the NODE env variable in Makefile
PR-URL: #51743 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Marco Ippolito <[email protected]>
1 parent 0ad88f6 commit 58255e7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ EXEEXT := $(shell $(PYTHON) -c \
7777
"import sys; print('.exe' if sys.platform == 'win32' else '')")
7878

7979
NODE_EXE = node$(EXEEXT)
80-
NODE ?= ./$(NODE_EXE)
80+
# Use $(PWD) so we can cd to anywhere before calling this
81+
NODE ?= "$(PWD)/$(NODE_EXE)"
8182
NODE_G_EXE = node_g$(EXEEXT)
8283
NPM ?= ./deps/npm/bin/npm-cli.js
8384

@@ -91,10 +92,9 @@ BUILD_RELEASE_FLAGS ?= $(BUILD_DOWNLOAD_FLAGS) $(BUILD_INTL_FLAGS)
9192
V ?= 0
9293

9394
# Use -e to double check in case it's a broken link
94-
# Use $(PWD) so we can cd to anywhere before calling this
9595
available-node = \
96-
if [ -x $(PWD)/$(NODE) ] && [ -e $(PWD)/$(NODE) ]; then \
97-
$(PWD)/$(NODE) $(1); \
96+
if [ -x "$(NODE)" ] && [ -e "$(NODE)" ]; then \
97+
"$(NODE)" $(1); \
9898
elif [ -x `command -v node` ] && [ -e `command -v node` ] && [ `command -v node` ]; then \
9999
`command -v node` $(1); \
100100
else \

0 commit comments

Comments
 (0)