swc/scripts/repo/count-files.sh
Donny/강동윤 8afb5af517
chore(repo): Make git faster (#3075)
swc_ecma_parser:
 - Flatten parser test suite ported from `tsc`.

swc:
 - Flatten the reference directory for the `tsc` test suite.
2021-12-20 14:05:57 +09:00

23 lines
475 B
Bash
Executable File

#!/usr/bin/env bash
#
# This script counts the number of files per each directory.
#
#
set -eu
find . -type d -empty -delete
find . -maxdepth 3 -mindepth 1 -type d | while read dir; do
if [[ $dir == ./.git* ]]; then
continue
fi
if git check-ignore "$dir" > /dev/null ; then
# echo "Ignoring $dir"
continue
fi
echo "Directory: $dir"
echo "Dir: $(find $dir -type d | wc -l)"
echo "File: $(find $dir -type f | wc -l)"
done