From 23c32ab3a7c3f97c02f5e04ac10ddae68d57924b Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Sun, 3 Mar 2024 21:06:53 +0100 Subject: [PATCH] build: respect the `NODE` env variable in `Makefile` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/51743 Reviewed-By: Richard Lau Reviewed-By: Michaƫl Zasso Reviewed-By: Luigi Pinca Reviewed-By: Marco Ippolito --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 1113873a21a298..7bd80d06c17125 100644 --- a/Makefile +++ b/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 \