Skip to content

Commit 305c169

Browse files
aduh95rdw-msft
authored andcommitted
build: respect the NODE env variable in Makefile
PR-URL: nodejs#51743 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
1 parent 7d9e323 commit 305c169

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)