chromedp/contrib/stats.sh

15 lines
546 B
Bash
Raw Normal View History

2017-01-24 15:09:23 +00:00
#!/bin/bash
2017-12-27 02:30:28 +00:00
BASE=$(realpath $(cd -P $GOPATH/src/github.com/chromedp && pwd))
2017-01-24 15:09:23 +00:00
2017-12-27 02:30:28 +00:00
FILES=$(find $BASE/{chromedp*,goquery,examples} -type f -iname \*.go -not -iname \*.qtpl.go -print0|wc -l --files0-from=-|head -n -1)$'\n'
2017-01-24 15:09:23 +00:00
2017-12-27 02:30:28 +00:00
AUTOG=$(find $BASE/cdproto/ -type f -iname \*.go -not -iname \*easyjson\* -print0|wc -l --files0-from=-|head -n -1)
2017-01-24 15:09:23 +00:00
if [ "$1" != "--total" ]; then
echo -e "code:\n$FILES\n\ngenerated:\n$AUTOG"
else
echo "code: $(awk '{s+=$1} END {print s}' <<< "$FILES")"
echo "generated: $(awk '{s+=$1} END {print s}' <<< "$AUTOG")"
fi