Skip to content

Commit

Permalink
feat: use command -v instead of which to find the installed path. (
Browse files Browse the repository at this point in the history
  • Loading branch information
mangoGoForward authored Apr 2, 2022
1 parent c9ce036 commit 97bcb56
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion bin/apisix
Original file line number Diff line number Diff line change
Expand Up @@ -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]+")
Expand Down
2 changes: 1 addition & 1 deletion ci/centos7-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions utils/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 97bcb56

Please sign in to comment.