Merge pull request #76808 from SataQiu/fix-hack-shellcheck-20190419

Fix shellcheck failures of hack/verify-readonly-packages.sh
This commit is contained in:
Kubernetes Prow Robot 2019-04-21 00:47:44 -07:00 committed by GitHub
commit 1377108c08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,19 +43,13 @@ find_files() {
\) -name '.readonly'
}
IFS=$'\n'
conflicts=()
while IFS=$'\n' read -r line; do
conflicts+=( "$line" )
done < <(find_files | sed 's|/.readonly||' | while read -r dir; do
while IFS=$'\n' read -r dir; do
dir=${dir#./}
if kube::util::has_changes "${branch}" "^${dir}/[^/]*\$" '/\.readonly$|/BUILD$|/zz_generated|/\.generated\.|\.proto$|\.pb\.go$' >/dev/null; then
echo "${dir}"
conflicts+=("${dir}")
fi
done)
unset IFS
done < <(find_files | sed 's|/.readonly||')
if [ ${#conflicts[@]} -gt 0 ]; then
exec 1>&2