13 lines
351 B
Bash
13 lines
351 B
Bash
#!/bin/bash
|
|
|
|
# Limit files in git to 1M.
|
|
IFS="
|
|
"
|
|
git ls-files | xargs -n1 du -k | grep -vE '^[[:digit:]]?[[:digit:]]?[[:digit:]][[:space:]]|venv|\s./.git/'
|
|
|
|
if [ $? -ne 1 ]; then
|
|
echo
|
|
echo "These files are probably larger than you want to commit to Git. Please try to find an alternate delivery path, such as a CDN or Git-LFS."
|
|
exit 1;
|
|
fi
|