Skip to content

Commit 2d167f0

Browse files
RaisinTenaduh95
authored andcommitted
build: replace which with command -v
PR-URL: nodejs#36118 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 3e0194e commit 2d167f0

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

.github/workflows/linters.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Environment Information
2525
run: npx envinfo
2626
- name: Lint addon docs
27-
run: NODE=$(which node) make lint-addon-docs
27+
run: NODE=$(command -v node) make lint-addon-docs
2828
lint-cpp:
2929
runs-on: ubuntu-latest
3030
steps:
@@ -50,7 +50,7 @@ jobs:
5050
- name: Lint docs
5151
run: |
5252
echo "::add-matcher::.github/workflows/remark-lint-problem-matcher.json"
53-
NODE=$(which node) make lint-md
53+
NODE=$(command -v node) make lint-md
5454
lint-js:
5555
runs-on: ubuntu-latest
5656
steps:
@@ -62,7 +62,7 @@ jobs:
6262
- name: Environment Information
6363
run: npx envinfo
6464
- name: Lint JavaScript files
65-
run: NODE=$(which node) make lint-js
65+
run: NODE=$(command -v node) make lint-js
6666
lint-py:
6767
runs-on: ubuntu-latest
6868
steps:
@@ -76,7 +76,7 @@ jobs:
7676
- name: Lint Python
7777
run: |
7878
make lint-py-build || true
79-
NODE=$(which node) make lint-py
79+
NODE=$(command -v node) make lint-py
8080
8181
lint-codeowners:
8282
runs-on: ubuntu-latest

.github/workflows/misc.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Environment Information
2424
run: npx envinfo
2525
- name: Build
26-
run: NODE=$(which node) make doc-only
26+
run: NODE=$(command -v node) make doc-only
2727
- uses: actions/upload-artifact@v1
2828
with:
2929
name: docs

BSDmakefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FLAGS=${.MAKEFLAGS:C/\-J ([0-9]+,?)+//W}
33

44
all: .DEFAULT
55
.DEFAULT:
6-
@which gmake > /dev/null 2>&1 ||\
6+
@command -v gmake > /dev/null 2>&1 ||\
77
(echo "GMake is required for node.js to build.\
88
Install and try again" && exit 1)
99
@gmake ${.FLAGS} ${.TARGETS}

Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ V ?= 0
6565
available-node = \
6666
if [ -x $(PWD)/$(NODE) ] && [ -e $(PWD)/$(NODE) ]; then \
6767
$(PWD)/$(NODE) $(1); \
68-
elif [ -x `which node` ] && [ -e `which node` ] && [ `which node` ]; then \
69-
`which node` $(1); \
68+
elif [ -x `command -v node` ] && [ -e `command -v node` ] && [ `command -v node` ]; then \
69+
`command -v node` $(1); \
7070
else \
7171
echo "No available node, cannot run \"node $(1)\""; \
7272
exit 1; \
@@ -898,7 +898,7 @@ BINARYNAME=$(TARNAME)-$(PLATFORM)-$(ARCH)
898898
endif
899899
BINARYTAR=$(BINARYNAME).tar
900900
# OSX doesn't have xz installed by default, http://macpkg.sourceforge.net/
901-
HAS_XZ ?= $(shell which xz > /dev/null 2>&1; [ $$? -eq 0 ] && echo 1 || echo 0)
901+
HAS_XZ ?= $(shell command -v xz > /dev/null 2>&1; [ $$? -eq 0 ] && echo 1 || echo 0)
902902
# Supply SKIP_XZ=1 to explicitly skip .tar.xz creation
903903
SKIP_XZ ?= 0
904904
XZ = $(shell [ $(HAS_XZ) -eq 1 -a $(SKIP_XZ) -eq 0 ] && echo 1 || echo 0)
@@ -1383,7 +1383,7 @@ lint-clean:
13831383
$(RM) tools/.*lintstamp
13841384
$(RM) .eslintcache
13851385

1386-
HAS_DOCKER ?= $(shell which docker > /dev/null 2>&1; [ $$? -eq 0 ] && echo 1 || echo 0)
1386+
HAS_DOCKER ?= $(shell command -v docker > /dev/null 2>&1; [ $$? -eq 0 ] && echo 1 || echo 0)
13871387

13881388
ifeq ($(HAS_DOCKER), 1)
13891389
DOCKER_COMMAND ?= docker run -it -v $(PWD):/node

android-configure

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ esac
5050

5151
HOST_OS="linux"
5252
HOST_ARCH="x86_64"
53-
export CC_host=$(which gcc)
54-
export CXX_host=$(which g++)
53+
export CC_host=$(command -v gcc)
54+
export CXX_host=$(command -v g++)
5555

5656
host_gcc_version=$($CC_host --version | grep gcc | awk '{print $NF}')
5757
major=$(echo $host_gcc_version | awk -F . '{print $1}')

0 commit comments

Comments
 (0)