Skip to content

Commit

Permalink
add script to detect large files
Browse files Browse the repository at this point in the history
  • Loading branch information
milesstoetzner committed Aug 5, 2023
1 parent a781251 commit 025a201
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
11 changes: 11 additions & 0 deletions cmds/check-large-files.sh
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}

0 comments on commit 025a201

Please sign in to comment.