Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace which with command -v #1320

Merged
merged 1 commit into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ endif
@echo
@benchstat $(OUTPUT_DIR)/bench_storage.old.txt $(OUTPUT_DIR)/bench_storage.txt

HAS_BENCHSTAT:=$(shell which benchstat)
HAS_BENCHSTAT:=$(shell command -v benchstat)
.PHONY: benchstat
benchstat:
ifndef HAS_BENCHSTAT
Expand Down Expand Up @@ -221,7 +221,7 @@ update: update-licenses update-lint update-toc update-deps update-generated
# License
# -------

HAS_ADDLICENSE:=$(shell which addlicense)
HAS_ADDLICENSE:=$(shell command -v addlicense)
.PHONY: verify-licenses
verify-licenses:addlicense
find -type f -name "*.go" ! -path "*/vendor/*" | xargs $(GOPATH)/bin/addlicense -check || (echo 'Run "make update"' && exit 1)
Expand Down Expand Up @@ -267,7 +267,7 @@ verify-toc: mdtoc $(docs_with_toc)
update-toc: mdtoc $(docs_with_toc)
$(GOPATH)/bin/mdtoc --inplace $(docs_with_toc)

HAS_MDTOC:=$(shell which mdtoc)
HAS_MDTOC:=$(shell command -v mdtoc)
.PHONY: mdtoc
mdtoc:
ifndef HAS_MDTOC
Expand All @@ -281,7 +281,7 @@ endif
verify-structured-logging: logcheck
$(GOPATH)/bin/logcheck ./... || (echo 'Fix structured logging' && exit 1)

HAS_LOGCHECK:=$(shell which logcheck)
HAS_LOGCHECK:=$(shell command -v logcheck)
.PHONY: logcheck
logcheck:
ifndef HAS_LOGCHECK
Expand Down
8 changes: 4 additions & 4 deletions test/test-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ delete_cluster() {
}

setup_helm() {
HELM=$(which helm || true)
HELM=$(command -v helm || true)
if [[ ${HELM} == "" || $(${HELM} |grep Version |awk -F'Version:' '{print $2}' |awk -F',' '{print $1}') != "\"v${HELM_VERSION}\"" ]] ; then
HELM=_output/helm
fi
Expand All @@ -30,7 +30,7 @@ setup_helm() {
}

setup_kind() {
KIND=$(which kind || true)
KIND=$(command -v kind || true)
if [[ ${KIND} == "" || $(${KIND} --version) != "kind version ${KIND_VERSION}" ]] ; then
KIND=_output/kind
fi
Expand All @@ -44,7 +44,7 @@ setup_kind() {
}

setup_skaffold() {
SKAFFOLD=$(which skaffold || true)
SKAFFOLD=$(command -v skaffold || true)
if [[ ${SKAFFOLD} == "" || $(${SKAFFOLD} version) != "v${SKAFFOLD_VERSION}" ]] ; then
SKAFFOLD=_output/skaffold
fi
Expand All @@ -62,7 +62,7 @@ get_kubectl_version() {
}

setup_kubectl() {
KUBECTL=$(which kubectl || true)
KUBECTL=$(command -v kubectl || true)
if [[ ${KUBECTL} == "" || $(get_kubectl_version) != "v${KUBECTL_VERSION}" ]] ; then
KUBECTL=_output/kubectl
fi
Expand Down