File: count-files.sh

package info (click to toggle)
rust-swc-core 35.0.0~ds-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 62,816 kB
  • sloc: javascript: 873; xml: 538; sh: 358; makefile: 35; python: 5
file content (23 lines) | stat: -rwxr-xr-x 475 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/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