You've already forked tribes-plugin-aether
forked from tribes/tribes-plugin-template
603ad5d0ae
Add a repo-local Guix manifest, direnv backend selection, and PATH-based hook configuration for the Aether plugin development environment.
39 lines
602 B
Bash
Executable File
39 lines
602 B
Bash
Executable File
#!/usr/bin/env sh
|
|
set -eu
|
|
|
|
maxkb=500
|
|
while [ "$#" -gt 0 ]; do
|
|
case "$1" in
|
|
--maxkb=*)
|
|
maxkb=${1#--maxkb=}
|
|
shift
|
|
;;
|
|
--)
|
|
shift
|
|
break
|
|
;;
|
|
-*)
|
|
echo "check-added-large-files: unknown option: $1" >&2
|
|
exit 2
|
|
;;
|
|
*)
|
|
break
|
|
;;
|
|
esac
|
|
done
|
|
|
|
limit=$((maxkb * 1024))
|
|
failed=0
|
|
|
|
for file in "$@"; do
|
|
[ -f "$file" ] || continue
|
|
size=$(wc -c < "$file" | tr -d '[:space:]')
|
|
if [ "$size" -gt "$limit" ]; then
|
|
kb=$(((size + 1023) / 1024))
|
|
echo "$file (${kb} KB) exceeds ${maxkb} KB" >&2
|
|
failed=1
|
|
fi
|
|
done
|
|
|
|
exit "$failed"
|