From 7ec2c1043bd0e5b511bfdf79eb215bc429effa24 Mon Sep 17 00:00:00 2001 From: danielqsj Date: Wed, 23 Jan 2019 20:56:25 +0800 Subject: [PATCH] fix shellcheck in sample-controller Kubernetes-commit: 078115a604fb4e89123b4a4e12530fd823abeb88 --- hack/update-codegen.sh | 12 ++++++------ hack/verify-codegen.sh | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index 1423a1af..196973b0 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -18,18 +18,18 @@ set -o errexit set -o nounset set -o pipefail -SCRIPT_ROOT=$(dirname ${BASH_SOURCE})/.. -CODEGEN_PKG=${CODEGEN_PKG:-$(cd ${SCRIPT_ROOT}; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ../code-generator)} +SCRIPT_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. +CODEGEN_PKG=${CODEGEN_PKG:-$(cd "${SCRIPT_ROOT}"; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ../code-generator)} # generate the code with: # --output-base because this script should also be able to run inside the vendor dir of # k8s.io/kubernetes. The output-base is needed for the generators to output into the vendor dir # instead of the $GOPATH directly. For normal projects this can be dropped. -${CODEGEN_PKG}/generate-groups.sh "deepcopy,client,informer,lister" \ +"${CODEGEN_PKG}"/generate-groups.sh "deepcopy,client,informer,lister" \ k8s.io/sample-controller/pkg/client k8s.io/sample-controller/pkg/apis \ samplecontroller:v1alpha1 \ - --output-base "$(dirname ${BASH_SOURCE})/../../.." \ - --go-header-file ${SCRIPT_ROOT}/hack/boilerplate.go.txt + --output-base "$(dirname "${BASH_SOURCE[0]}")/../../.." \ + --go-header-file "${SCRIPT_ROOT}"/hack/boilerplate.go.txt # To use your own boilerplate text use: -# --go-header-file ${SCRIPT_ROOT}/hack/custom-boilerplate.go.txt +# --go-header-file "${SCRIPT_ROOT}"/hack/custom-boilerplate.go.txt diff --git a/hack/verify-codegen.sh b/hack/verify-codegen.sh index d02a6fa3..d91566e6 100755 --- a/hack/verify-codegen.sh +++ b/hack/verify-codegen.sh @@ -18,7 +18,7 @@ set -o errexit set -o nounset set -o pipefail -SCRIPT_ROOT=$(dirname "${BASH_SOURCE}")/.. +SCRIPT_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. DIFFROOT="${SCRIPT_ROOT}/pkg" TMP_DIFFROOT="${SCRIPT_ROOT}/_tmp/pkg"