diff --git a/Makefile b/Makefile index 36f659c74f35..00f39888f1a7 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,7 @@ ENV_RM ?= rm -vf ENV_DOCKER ?= docker ENV_DOCKER_COMPOSE ?= docker-compose --project-directory $(CURDIR) -p $(project_name) -f $(project_compose_ci) ENV_NGINX ?= $(ENV_NGINX_EXEC) -p $(CURDIR) -c $(CURDIR)/conf/nginx.conf -ENV_NGINX_EXEC := $(shell which openresty 2>/dev/null || which nginx 2>/dev/null) +ENV_NGINX_EXEC := $(shell command -v openresty 2>/dev/null || command -v nginx 2>/dev/null) ENV_OPENSSL_PREFIX ?= $(addprefix $(ENV_NGINX_PREFIX), openssl) ENV_LUAROCKS ?= luarocks ## These variables can be injected by luarocks diff --git a/bin/apisix b/bin/apisix index d83b0ce4b1a2..409ece52fea1 100755 --- a/bin/apisix +++ b/bin/apisix @@ -29,7 +29,7 @@ else fi # find the openresty -OR_BIN=$(which openresty || exit 1) +OR_BIN=$(command -v openresty || exit 1) OR_EXEC=${OR_BIN:-'/usr/local/openresty-debug/bin/openresty'} OR_VER=$(openresty -v 2>&1 | awk -F '/' '{print $2}' | awk -F '.' '{print $1"."$2}') LUA_VERSION=$(lua -v 2>&1| grep -E -o "Lua [0-9]+.[0-9]+") diff --git a/ci/centos7-ci.sh b/ci/centos7-ci.sh index e29d40152253..1eefc142589f 100755 --- a/ci/centos7-ci.sh +++ b/ci/centos7-ci.sh @@ -23,7 +23,7 @@ install_dependencies() { # install development tools yum install -y wget tar gcc automake autoconf libtool make unzip \ - git which sudo openldap-devel + git sudo openldap-devel # curl with http2 wget https://github.com/moparisthebest/static-curl/releases/download/v7.79.1/curl-amd64 -O /usr/bin/curl diff --git a/utils/install-dependencies.sh b/utils/install-dependencies.sh index d4ebd36abdb3..fc0b03de0d94 100755 --- a/utils/install-dependencies.sh +++ b/utils/install-dependencies.sh @@ -20,9 +20,9 @@ set -ex function detect_aur_helper() { - if [[ $(which yay) ]]; then + if [[ $(command -v yay) ]]; then AUR_HELPER=yay - elif [[ $(which pacaur) ]]; then + elif [[ $(command -v pacaur) ]]; then AUR_HELPER=pacaur else echo No available AUR helpers found. Please specify your AUR helper by AUR_HELPER.