Merge pull request #124156 from bells17/support-mac-os-verify-file-size

[hack/verify-file-sizes.sh] Support Mac OS X
This commit is contained in:
Kubernetes Prow Robot 2024-04-19 15:31:04 -07:00 committed by GitHub
commit bad0f06520
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -42,7 +42,7 @@ largefiles () {
case "$tree" in
w/-text)
# Only binary files have a size limit.
size="$(stat --printf=%s "$file")"
size="$(wc -c < "$file")"
if [ "${size}" -gt "$maxsize" ] &&
! kube::util::array_contains "$file" "${allowlist[@]}"; then
echo "$file is too large ($size bytes)"