chromedp/contrib/stats.sh

17 lines
718 B
Bash
Raw Normal View History

2017-01-24 15:09:23 +00:00
#!/bin/bash
SRC=$GOPATH/src/github.com/knq/chromedp
FILES=$(find $SRC/cmd/chromedp-gen -type f -iname \*.go -not -iname \*.qtpl.go -print0|wc -l --files0-from=-|head -n -1)$'\n'
FILES+=$(find $SRC/{client,runner,contrib,examples} -type f -iname \*.go -print0|wc -l --files0-from=-|head -n -1)$'\n'
FILES+=$(find $SRC/ -maxdepth 1 -type f -iname \*.go -print0|wc -l --files0-from=-|head -n -1)
AUTOG=$(find $SRC/cdp/ -type f -iname \*.go -not -iname \*easyjson\* -print0|wc -l --files0-from=-|head -n -1)
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