mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
build: respect the NODE env variable in Makefile
PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
8
Makefile
8
Makefile
@@ -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
|
||||
|
||||
@@ -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 \
|
||||
|
||||
Reference in New Issue
Block a user