From a20aec8d2ddccdcdc654951801098c9ff069cdbf Mon Sep 17 00:00:00 2001 From: SataQiu Date: Fri, 19 Apr 2019 23:28:34 +0800 Subject: [PATCH] fix shellcheck failures of hack/verify-openapi-spec.sh --- hack/.shellcheck_failures | 1 - hack/verify-openapi-spec.sh | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/hack/.shellcheck_failures b/hack/.shellcheck_failures index 3802b45be93..869f3fdd03a 100644 --- a/hack/.shellcheck_failures +++ b/hack/.shellcheck_failures @@ -47,7 +47,6 @@ ./hack/verify-codegen.sh ./hack/verify-golint.sh ./hack/verify-no-vendor-cycles.sh -./hack/verify-openapi-spec.sh ./hack/verify-readonly-packages.sh ./hack/verify-test-featuregates.sh ./test/cmd/apply.sh diff --git a/hack/verify-openapi-spec.sh b/hack/verify-openapi-spec.sh index 38501e821d9..6965a6754ef 100755 --- a/hack/verify-openapi-spec.sh +++ b/hack/verify-openapi-spec.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::golang::setup_env @@ -32,10 +32,10 @@ _tmp="${KUBE_ROOT}/_tmp" mkdir -p "${_tmp}" cp -a "${SPECROOT}" "${TMP_SPECROOT}" -trap "cp -a ${TMP_SPECROOT} ${SPECROOT}/..; rm -rf ${_tmp}" EXIT SIGINT -rm ${SPECROOT}/* -cp ${TMP_SPECROOT}/BUILD ${SPECROOT}/BUILD -cp ${TMP_SPECROOT}/README.md ${SPECROOT}/README.md +trap 'cp -a "${TMP_SPECROOT}" "${SPECROOT}"/..; rm -rf "${_tmp}"' EXIT SIGINT +rm "${SPECROOT}"/* +cp "${TMP_SPECROOT}/BUILD" "${SPECROOT}/BUILD" +cp "${TMP_SPECROOT}/README.md" "${SPECROOT}/README.md" "${KUBE_ROOT}/hack/update-openapi-spec.sh" echo "diffing ${SPECROOT} against freshly generated openapi spec"