From f82870291f753db945c7d8cc7f9681897f118688 Mon Sep 17 00:00:00 2001 From: aaa <1693291525@qq.com> Date: Wed, 20 Mar 2019 18:39:34 -0400 Subject: [PATCH] Fix shellcheck failures in godep-save.sh and godep-restore.sh update pull request update pull request --- hack/.shellcheck_failures | 2 -- hack/godep-restore.sh | 2 +- hack/godep-save.sh | 7 ++++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/hack/.shellcheck_failures b/hack/.shellcheck_failures index 1fb425df707..9d97cb0ce99 100644 --- a/hack/.shellcheck_failures +++ b/hack/.shellcheck_failures @@ -26,8 +26,6 @@ ./cluster/validate-cluster.sh ./hack/cherry_pick_pull.sh ./hack/ginkgo-e2e.sh -./hack/godep-restore.sh -./hack/godep-save.sh ./hack/grab-profiles.sh ./hack/jenkins/benchmark-dockerized.sh ./hack/jenkins/build.sh diff --git a/hack/godep-restore.sh b/hack/godep-restore.sh index a58fab974ac..2f1b10784f4 100755 --- a/hack/godep-restore.sh +++ b/hack/godep-restore.sh @@ -18,7 +18,7 @@ set -o errexit set -o nounset set -o pipefail -KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. +KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. source "${KUBE_ROOT}/hack/lib/init.sh" kube::log::status "Restoring kubernetes godeps" diff --git a/hack/godep-save.sh b/hack/godep-save.sh index 9eaa59e570b..6430b6e6b3d 100755 --- a/hack/godep-save.sh +++ b/hack/godep-save.sh @@ -18,7 +18,7 @@ set -o errexit set -o nounset set -o pipefail -KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. +KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. source "${KUBE_ROOT}/hack/lib/init.sh" kube::log::status "Ensuring prereqs" @@ -88,11 +88,12 @@ kube::log::status "Running godep save - this might take a while" # This uses $(pwd) rather than ${KUBE_ROOT} because KUBE_ROOT will be # realpath'ed, and godep barfs ("... is not using a known version control # system") on our staging dirs. -GOPATH="${GOPATH}:$(pwd)/staging" ${KUBE_GODEP:?} save -i $(IFS=,; echo "${IGNORED_PACKAGES[*]}") "${REQUIRED_BINS[@]}" +GOPATH="${GOPATH}:$(pwd)/staging" "${KUBE_GODEP:?}" save -i "$(IFS=,; echo "${IGNORED_PACKAGES[*]}")" "${REQUIRED_BINS[@]}" # create a symlink in vendor directory pointing to the staging client. This # let other packages use the staging client as if it were vendored. -for repo in $(ls staging/src/k8s.io); do +for repo in staging/src/k8s.io/*; do + repo="${repo#staging/src/k8s.io/}" if [ ! -e "vendor/k8s.io/${repo}" ]; then ln -s "../../staging/src/k8s.io/${repo}" "vendor/k8s.io/${repo}" fi