File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ #
3+ # Prints the number of files in a package.
4+ #
5+ # <package_path> <number_of_files>
6+
7+ # Determine root directory:
8+ root=" $( git rev-parse --show-toplevel) "
9+
10+ # Define the path to a utility to list packages:
11+ find_pkgs=" ${root} /tools/scripts/find_packages"
12+
13+ # Define the path to a utility to list files:
14+ find_files=" ${root} /tools/scripts/find_files"
15+
16+ # Get a list of packages:
17+ pkgs=" $( PACKAGES_FILTER=${PACKAGES_FILTER} ${find_pkgs} ) "
18+
19+ # For each package, determine the number of files...
20+ for pkg in ${pkgs} ; do
21+ # * `find_files`
22+ # - Find package files.
23+ # * `wc -l`
24+ # - Compute the number of lines.
25+ # * `awk '{}'`
26+ # - Print results.
27+ FILES_PATTERN=" ${FILES_PATTERN} " FILES_FILTER=" $pkg /.*" " ${find_files} " | wc -l | awk -v pkg=" $pkg " ' { print pkg OFS $1 }'
28+ done
You can’t perform that action at this time.
0 commit comments