fix shellcheck failures of hack/verify-readonly-packages.sh

k3s-v1.15.3
SataQiu 2019-04-20 14:10:58 +08:00
parent f8378468b6
commit 43095d9218
1 changed files with 3 additions and 9 deletions

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