Skip to content

Commit e05f85a

Browse files
committed
Fix shellcheck failures on verify-readonly-packages.sh
1 parent ac1557a commit e05f85a

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

hack/.shellcheck_failures

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
./hack/verify-golint.sh
4848
./hack/verify-no-vendor-cycles.sh
4949
./hack/verify-openapi-spec.sh
50-
./hack/verify-readonly-packages.sh
5150
./hack/verify-test-featuregates.sh
5251
./test/cmd/apply.sh
5352
./test/cmd/apps.sh

hack/verify-readonly-packages.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ set -o errexit
2222
set -o nounset
2323
set -o pipefail
2424

25-
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
25+
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
2626
source "${KUBE_ROOT}/hack/lib/init.sh"
2727

2828
readonly branch=${1:-${KUBE_VERIFY_GIT_BRANCH:-master}}
@@ -44,12 +44,17 @@ find_files() {
4444
}
4545

4646
IFS=$'\n'
47-
conflicts=($(find_files | sed 's|/.readonly||' | while read dir; do
47+
48+
conflicts=()
49+
while IFS=$'\n' read -r line; do
50+
conflicts+=( "$line" )
51+
done < <(find_files | sed 's|/.readonly||' | while read -r dir; do
4852
dir=${dir#./}
4953
if kube::util::has_changes "${branch}" "^${dir}/[^/]*\$" '/\.readonly$|/BUILD$|/zz_generated|/\.generated\.|\.proto$|\.pb\.go$' >/dev/null; then
5054
echo "${dir}"
5155
fi
52-
done))
56+
done)
57+
5358
unset IFS
5459
5560
if [ ${#conflicts[@]} -gt 0 ]; then

0 commit comments

Comments
 (0)