aboutsummaryrefslogtreecommitdiffstats
path: root/maintenance/metrics.sh
blob: 5575e281407c251fb6e0f028df2bc537e8eef273 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

basedir="$(dirname "$0")"
[ "$(echo "$basedir" | cut -c1)" = '/' ] || basedir="$PWD/$basedir"

[ $# -ge 1 ] || {
	echo "Usage: $0 [CLOC-OPTS] DIRECTORY" >&2
	exit 1
}

set -e

cd "$basedir/.."
submodpaths="$(git submodule status | awk '{print $2;}' | tr "[:space:]" ",")"

cloc --exclude-dir="build,dist,release-archives,icons,${submodpaths}" \
	--read-lang-def="${basedir}/cloc-lang-awl.txt" \
	--quiet --progress-rate=0 \
	"$@"
bues.ch cgit interface