From 253c7aa0cad3e64d1a15d6a249f0549553910ada Mon Sep 17 00:00:00 2001 From: danielqsj Date: Wed, 23 Jan 2019 21:09:06 +0800 Subject: [PATCH] fix shellcheck in node-api --- hack/.shellcheck_failures | 2 -- staging/src/k8s.io/node-api/hack/update-codegen.sh | 10 +++++----- staging/src/k8s.io/node-api/hack/verify-codegen.sh | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/hack/.shellcheck_failures b/hack/.shellcheck_failures index 7618849f48..10e5849ace 100644 --- a/hack/.shellcheck_failures +++ b/hack/.shellcheck_failures @@ -165,8 +165,6 @@ ./staging/src/k8s.io/kube-aggregator/hack/verify-codegen.sh ./staging/src/k8s.io/metrics/hack/update-codegen.sh ./staging/src/k8s.io/metrics/hack/verify-codegen.sh -./staging/src/k8s.io/node-api/hack/update-codegen.sh -./staging/src/k8s.io/node-api/hack/verify-codegen.sh ./test/cmd/apply.sh ./test/cmd/apps.sh ./test/cmd/authorization.sh diff --git a/staging/src/k8s.io/node-api/hack/update-codegen.sh b/staging/src/k8s.io/node-api/hack/update-codegen.sh index c92b3cc9f6..44c091269a 100755 --- a/staging/src/k8s.io/node-api/hack/update-codegen.sh +++ b/staging/src/k8s.io/node-api/hack/update-codegen.sh @@ -18,15 +18,15 @@ 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/node-api/pkg/client k8s.io/node-api/pkg/apis \ "node: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" diff --git a/staging/src/k8s.io/node-api/hack/verify-codegen.sh b/staging/src/k8s.io/node-api/hack/verify-codegen.sh index d02a6fa395..d91566e622 100755 --- a/staging/src/k8s.io/node-api/hack/verify-codegen.sh +++ b/staging/src/k8s.io/node-api/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"