diff --git a/cmds/check-large-files.sh b/cmds/check-large-files.sh new file mode 100644 index 0000000000..5e76abaf0a --- /dev/null +++ b/cmds/check-large-files.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +set -e + +# See https://stackoverflow.com/a/42544963 +git rev-list --objects --all | + git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' | + sed -n 's/^blob //p' | + awk '$2 >= 2^20' | + sort --numeric-sort --key=2 | + cut -c 1-12,41- | + $(command -v gnumfmt || echo numfmt) --field=2 --to=iec-i --suffix=B --padding=7 --round=nearest \ No newline at end of file diff --git a/package.json b/package.json index d0aea5d25f..fed6aa5cf4 100644 --- a/package.json +++ b/package.json @@ -133,6 +133,7 @@ "puccini:check": "bash docs/cmds/puccini/check-all.sh", "puccini:check:single": "bash docs/cmds/puccini/check.sh", "puml:up": "cd docs && docker-compose up -d", - "puml:down": "cd docs && docker-compose down" + "puml:down": "cd docs && docker-compose down", + "large:check": "bash cmds/check-large-files.sh" } }