Skip to content

Commit

Permalink
build: respect the NODE env variable in Makefile
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
aduh95 authored and richardlau committed Mar 25, 2024
1 parent 0ad88f6 commit 58255e7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ EXEEXT := $(shell $(PYTHON) -c \
"import sys; print('.exe' if sys.platform == 'win32' else '')")

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

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

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

0 comments on commit 58255e7

Please sign in to comment.