summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Guo <yangguo@chromium.org>2018-01-08 16:31:07 +0100
committerYang Guo <yangguo@chromium.org>2018-01-11 07:52:21 +0100
commita2c7085dd4a8e60d1a47572aca8bb6fcb7a32f88 (patch)
tree7f2fbcb646229b4ccccdaeaeb4d2a0196bb2ace1
parent315d1f553de9c1c5cf0ab9ee2623b5420bee8a09 (diff)
downloadandroid-node-v8-a2c7085dd4a8e60d1a47572aca8bb6fcb7a32f88.tar.gz
android-node-v8-a2c7085dd4a8e60d1a47572aca8bb6fcb7a32f88.tar.bz2
android-node-v8-a2c7085dd4a8e60d1a47572aca8bb6fcb7a32f88.zip
build: fix Makefile wrt finding node executable
Not all shells set PWD, so use CURDIR instead. `which node` may return the empty string, so guard against that too. Consider: if [ -x `which velociraptor` ] && [ -e `which velociprator` ];\ then echo "run"; else echo "keep calm"; fi; PR-URL: https://github.com/nodejs/node/pull/18040 Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
-rw-r--r--Makefile3
1 files changed, 2 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 213284aa70..3763c78e91 100644
--- a/Makefile
+++ b/Makefile
@@ -14,6 +14,7 @@ COVTESTS ?= test-cov
GTEST_FILTER ?= "*"
GNUMAKEFLAGS += --no-print-directory
GCOV ?= gcov
+PWD = $(CURDIR)
ifdef JOBS
PARALLEL_ARGS = -j $(JOBS)
@@ -640,7 +641,7 @@ out/doc/api/assets/%: doc/api_assets/% out/doc/api/assets
available-node = \
if [ -x $(PWD)/$(NODE) ] && [ -e $(PWD)/$(NODE) ]; then \
$(PWD)/$(NODE) $(1); \
- elif [ -x `which node` ] && [ -e `which node` ]; then \
+ elif [ -x `which node` ] && [ -e `which node` ] && [ `which node` ]; then \
`which node` $(1); \
else \
echo "No available node, cannot run \"node $(1)\""; \