Repository: nodejs/node
Pull request: build: fix inconsistent quoting in `Makefile`

Currently `available-node` results in something that looks like `if [ -x ""…/node"" ] && [ -e ""…/node"" ]; then…`, the double quoting is clearly not helpful.
I went with using single quotes in case the path contains weird chars (although it wouldn't help if PWD itself contains a single quote, but oh well), I left out the `$(PYTHON)` calls in case someone is passing flags to Python that way.

<!--
Before submitting a pull request, please read:

- the CONTRIBUTING guide at https://github.com/nodejs/node/blob/HEAD/CONTRIBUTING.md
- the commit message formatting guidelines at
  https://github.com/nodejs/node/blob/HEAD/doc/contributing/pull-requests.md#commit-message-guidelines

For code changes:
1. Include tests for any bug fixes or new features.
2. Update documentation if relevant.
3. Ensure that `make -j4 test` (UNIX), or `vcbuild test` (Windows) passes.

If you believe this PR should be highlighted in the Node.js CHANGELOG
please add the `notable-change` label.

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.
-->


Changed files:
filename: Makefile
patch: @@ -17,7 +17,7 @@ endif
 ARCHTYPE := $(shell uname -m | tr '[:upper:]' '[:lower:]')
 COVTESTS ?= test-cov
 COV_SKIP_TESTS ?= core_line_numbers.js,testFinalizer.js,test_function/test.js
-GTEST_FILTER ?= "*"
+GTEST_FILTER ?= *
 GNUMAKEFLAGS += --no-print-directory
 GCOV ?= gcov
 PWD = $(CURDIR)
@@ -31,9 +31,9 @@ else
 endif
 
 ifdef ENABLE_V8_TAP
-	TAP_V8 := --junitout $(PWD)/v8-tap.xml
-	TAP_V8_INTL := --junitout $(PWD)/v8-intl-tap.xml
-	TAP_V8_BENCHMARKS := --junitout $(PWD)/v8-benchmarks-tap.xml
+	TAP_V8 := --junitout '$(PWD)/v8-tap.xml'
+	TAP_V8_INTL := --junitout '$(PWD)/v8-intl-tap.xml'
+	TAP_V8_BENCHMARKS := --junitout '$(PWD)/v8-benchmarks-tap.xml'
 define convert_to_junit
 	@true
 endef
@@ -47,12 +47,12 @@ ifdef ENABLE_CONVERT_V8_JSON_TO_XML
 	# By default, the V8's JSON test output only includes the tests which have
 	# failed. We use --slow-tests-cutoff to ensure that all tests are present
 	# in the output, including those which pass.
-	TAP_V8 := --json-test-results $(TAP_V8_JSON) --slow-tests-cutoff 1000000
-	TAP_V8_INTL := --json-test-results $(TAP_V8_INTL_JSON) --slow-tests-cutoff 1000000
-	TAP_V8_BENCHMARKS := --json-test-results $(TAP_V8_BENCHMARKS_JSON) --slow-tests-cutoff 1000000
+	TAP_V8 := --json-test-results '$(TAP_V8_JSON)' --slow-tests-cutoff 1000000
+	TAP_V8_INTL := --json-test-results '$(TAP_V8_INTL_JSON)' --slow-tests-cutoff 1000000
+	TAP_V8_BENCHMARKS := --json-test-results '$(TAP_V8_BENCHMARKS_JSON)' --slow-tests-cutoff 1000000
 
 define convert_to_junit
-	export PATH="$(NO_BIN_OVERRIDE_PATH)" && \
+	PATH="$(NO_BIN_OVERRIDE_PATH)" \
 		$(PYTHON) tools/v8-json-to-junit.py < $(1) > $(1:.json=.xml)
 endef
 endif
@@ -83,11 +83,11 @@ NPM ?= ./deps/npm/bin/npm-cli.js
 
 # Release build of node.
 # Use $(PWD) so we can cd to anywhere before calling this.
-NODE ?= "$(PWD)/$(NODE_EXE)"
+NODE ?= $(PWD)/$(NODE_EXE)
 # Prefer $(OUT_NODE) when running tests. Use $(NODE)
 # when generating coverage reports or running toolings as
 # debug build is be slower.
-OUT_NODE ?= "$(PWD)/out/$(BUILDTYPE)/node$(EXEEXT)"
+OUT_NODE ?= $(PWD)/out/$(BUILDTYPE)/node$(EXEEXT)
 
 # Flags for packaging.
 BUILD_DOWNLOAD_FLAGS ?= --download=all
@@ -100,8 +100,8 @@ V ?= 0
 
 # Use -e to double check in case it's a broken link
 available-node = \
-	if [ -x "$(NODE)" ] && [ -e "$(NODE)" ]; then \
-		"$(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 \
@@ -268,7 +268,7 @@ coverage-build: all ## Build coverage files.
 coverage-build-js: ## Build JavaScript coverage files.
 	mkdir -p node_modules
 	if [ ! -d node_modules/c8 ]; then \
-		$(NODE) ./deps/npm install c8 --no-save --no-package-lock;\
+		'$(NODE)' ./deps/npm install c8 --no-save --no-package-lock;\
 	fi
 
 .PHONY: coverage-test
@@ -295,13 +295,13 @@ coverage-test: coverage-build ## Run the tests and generate a coverage report.
 .PHONY: coverage-report-js
 coverage-report-js: ## Report JavaScript coverage results.
 	-$(MAKE) coverage-build-js
-	$(NODE) ./node_modules/.bin/c8 report
+	'$(NODE)' ./node_modules/.bin/c8 report
 
 .PHONY: cctest
 
 cctest: all ## Run the C++ tests using the built `cctest` executable.
 	@out/$(BUILDTYPE)/$@ --gtest_filter=$(GTEST_FILTER)
-	$(OUT_NODE) ./test/embedding/test-embedding.js
+	'$(OUT_NODE)' ./test/embedding/test-embedding.js
 
 .PHONY: list-gtests
 list-gtests: ## List all available C++ gtests.
@@ -393,7 +393,7 @@ test/addons/.docbuildstamp: $(DOCBUILDSTAMP_PREREQS) tools/doc/node_modules
 		echo "Skipping .docbuildstamp (no crypto and/or no ICU)"; \
 	else \
 		$(RM) -r test/addons/??_*/; \
-		[ -x $(NODE) ] && $(NODE) $< || node $< ; \
+		[ -x '$(NODE)' ] && '$(NODE)' $< || node $< ; \
 		[ $$? -eq 0 ] && touch $@; \
 	fi
 
@@ -613,7 +613,7 @@ test-ci: | clear-stalled bench-addons-build build-addons build-js-native-api-tes
 	$(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \
 		--mode=$(BUILDTYPE_LOWER) --flaky-tests=$(FLAKY_TESTS) \
 		$(TEST_CI_ARGS) $(CI_JS_SUITES) $(CI_NATIVE_SUITES) $(CI_DOC)
-	$(OUT_NODE) ./test/embedding/test-embedding.js
+	'$(OUT_NODE)' ./test/embedding/test-embedding.js
 	$(info Clean up any leftover processes, error if found.)
 	ps awwx | grep Release/node | grep -v grep | cat
 	@PS_OUT=`ps awwx | grep Release/node | grep -v grep | awk '{print $$1}'`; \
@@ -663,8 +663,8 @@ test-wpt: all ## Run the Web Platform Tests.
 test-wpt-report: ## Run the Web Platform Tests and generate a report.
 	$(RM) -r out/wpt
 	mkdir -p out/wpt
-	-WPT_REPORT=1 $(PYTHON) tools/test.py --shell $(NODE) $(PARALLEL_ARGS) wpt
-	$(NODE) "$$PWD/tools/merge-wpt-reports.mjs"
+	-WPT_REPORT=1 $(PYTHON) tools/test.py --shell '$(NODE)' $(PARALLEL_ARGS) wpt
+	'$(NODE)' "$$PWD/tools/merge-wpt-reports.mjs"
 
 .PHONY: test-internet
 test-internet: all ## Run internet tests.
@@ -684,7 +684,7 @@ test-doc: doc-only lint-md ## Build, lint, and verify the docs.
 
 .PHONY: test-doc-ci
 test-doc-ci: doc-only ## Build, lint, and verify the docs (CI).
-	$(PYTHON) tools/test.py --shell $(NODE) $(TEST_CI_ARGS) $(PARALLEL_ARGS) doctool
+	$(PYTHON) tools/test.py --shell '$(NODE)' $(TEST_CI_ARGS) $(PARALLEL_ARGS) doctool
 
 .PHONY: test-known-issues
 test-known-issues: all ## Run tests for known issues.
@@ -693,11 +693,11 @@ test-known-issues: all ## Run tests for known issues.
 # Related CI job: node-test-npm
 .PHONY: test-npm
 test-npm: $(OUT_NODE) ## Run the npm test suite on deps/npm.
-	$(OUT_NODE) tools/test-npm-package --install --logfile=test-npm.tap deps/npm test
+	'$(OUT_NODE)' tools/test-npm-package --install --logfile=test-npm.tap deps/npm test
 
 .PHONY: test-npm-publish
 test-npm-publish: $(OUT_NODE) ## Test the `npm publish` command.
-	npm_package_config_publishtest=true $(OUT_NODE) deps/npm/test/run.js
+	npm_package_config_publishtest=true '$(OUT_NODE)' deps/npm/test/run.js
 
 .PHONY: test-js-native-api
 test-js-native-api: test-build-js-native-api ## Run JS Native-API tests.
@@ -841,7 +841,7 @@ out/doc/api/assets/%: doc/api_assets/% | out/doc/api/assets
 	@cp $< $@ ; $(RM) out/doc/api/assets/README.md
 
 
-run-npm-ci = $(PWD)/$(NPM) ci
+run-npm-ci = '$(PWD)/$(NPM)' ci
 
 LINK_DATA = out/doc/apilinks.json
 VERSIONS_DATA = out/previous-doc-versions.json
@@ -1181,7 +1181,7 @@ endif
 		$(MACOSOUTDIR)/dist/npm/usr/local/lib/node_modules
 	unlink $(MACOSOUTDIR)/dist/node/usr/local/bin/npm
 	unlink $(MACOSOUTDIR)/dist/node/usr/local/bin/npx
-	$(NODE) tools/license2rtf.mjs < LICENSE > \
+	'$(NODE)' tools/license2rtf.mjs < LICENSE > \
 		$(MACOSOUTDIR)/installer/productbuild/Resources/license.rtf
 	cp doc/osx_installer_logo.png $(MACOSOUTDIR)/installer/productbuild/Resources
 	pkgbuild --version $(FULLVERSION) \
@@ -1680,8 +1680,8 @@ HAS_DOCKER ?= $(shell command -v docker > /dev/null 2>&1; [ $$? -eq 0 ] && echo
 
 .PHONY: gen-openssl
 ifeq ($(HAS_DOCKER), 1)
-DOCKER_COMMAND ?= docker run --rm -u $(shell id -u) -v $(PWD):/node
-IS_IN_WORKTREE = $(shell grep '^gitdir: ' $(PWD)/.git 2>/dev/null)
+DOCKER_COMMAND ?= docker run --rm -u $(shell id -u) -v '$(PWD):/node'
+IS_IN_WORKTREE = $(shell grep '^gitdir: ' '$(PWD)/.git' 2>/dev/null)
 GIT_WORKTREE_COMMON = $(shell git rev-parse --git-common-dir)
 DOCKER_COMMAND += $(if $(IS_IN_WORKTREE), -v $(GIT_WORKTREE_COMMON):$(GIT_WORKTREE_COMMON))
 gen-openssl: ## Generate platform dependent openssl files (requires docker).