From e2c8755b70f69332887116dcee6e52c3ba889abc Mon Sep 17 00:00:00 2001 From: tenzen-y Date: Sat, 4 Jun 2022 17:56:37 +0900 Subject: [PATCH] fix shellcheck --- examples/v1beta1/kind-cluster/deploy.sh | 6 +++--- hack/verify-gofmt.sh | 2 +- hack/verify-golangci-lint.sh | 2 +- hack/verify-shellcheck.sh | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/v1beta1/kind-cluster/deploy.sh b/examples/v1beta1/kind-cluster/deploy.sh index 062b16b7b71..15e8d9c4627 100755 --- a/examples/v1beta1/kind-cluster/deploy.sh +++ b/examples/v1beta1/kind-cluster/deploy.sh @@ -18,19 +18,19 @@ set -e # Verify that appropriate tools are installed. -if [[ ! $(which docker) ]]; then +if [ -z "$(command -v docker)" ]; then echo "Unable to find Docker" echo "To install Docker, please follow this guide: https://docs.docker.com/get-docker" exit 1 fi -if [[ ! $(which kind) ]]; then +if [ -z "$(command -v kind)" ]; then echo "Unable to find Kind" echo "To install Kind, please follow this guide: https://kind.sigs.k8s.io/docs/user/quick-start/#installation" exit 1 fi -if [[ ! $(which kubectl) ]]; then +if [ "$(command -v kubectl)" ]; then echo "Unable to find kubectl" echo "To install kubectl, please follow this guide: https://kubernetes.io/docs/tasks/tools/#kubectl" exit 1 diff --git a/hack/verify-gofmt.sh b/hack/verify-gofmt.sh index 6fdf0861d0f..fa974d95a43 100755 --- a/hack/verify-gofmt.sh +++ b/hack/verify-gofmt.sh @@ -18,7 +18,7 @@ set -o errexit set -o nounset set -o pipefail -if ! which gofmt >/dev/null; then +if [ -z "$(command -v gofmt)" ]; then echo "Can not find gofmt" exit 1 fi diff --git a/hack/verify-golangci-lint.sh b/hack/verify-golangci-lint.sh index 4073aef8b96..4d0bb9bac78 100755 --- a/hack/verify-golangci-lint.sh +++ b/hack/verify-golangci-lint.sh @@ -19,7 +19,7 @@ set -o pipefail cd "$(dirname "$0")/.." -if ! which golangci-lint >/dev/null; then +if [ -z "$(command -v golangci-lint)" ]; then echo 'Can not find golangci-lint, install with: make lint' exit 1 fi diff --git a/hack/verify-shellcheck.sh b/hack/verify-shellcheck.sh index 34e93903f83..6129d892253 100755 --- a/hack/verify-shellcheck.sh +++ b/hack/verify-shellcheck.sh @@ -19,7 +19,7 @@ set -o pipefail cd "$(dirname "$0")/.." -if ! which shellcheck >/dev/null; then +if [ -z "$(command -v shellcheck)" ]; then echo 'Can not find shellcheck, install with: make shellcheck' exit 1 fi