2017-01-24 15:09:23 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-02-12 04:59:33 +00:00
|
|
|
SRC=$(realpath $(cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/../)
|
2017-01-24 15:09:23 +00:00
|
|
|
|
|
|
|
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
|