We must prevent the uncontrolled growth of a dependency folder via developers.
./check_size.sh --limit 3GB ./node_modules ./packages/*/node_modules
# ^ fail if limit was overtaken
I'm guessing bash
is okay.
Something like this?
SIZE=`du -cs ./node_modules ./packagese/*/node_modules | cut -f 1 | tail -1`
if [ $SIZE -gt 3145728 ]; then
echo 'Too big'
exit 1
fi