chromedp/cmd/chromedp-gen/build.sh

33 lines
468 B
Bash
Raw Normal View History

2017-01-24 15:09:23 +00:00
#!/bin/bash
2017-06-17 00:56:52 +00:00
UPDATE=0
LASTUPDATE=0
if [ -f .last ]; then
LASTUPDATE=$(cat .last)
fi
NOW=$(date +%s)
if (( "$NOW" >= $(($LASTUPDATE + 86400*5)) )); then
UPDATE=1
fi
if [[ "$UPDATE" == 1 ]]; then
go get -u \
golang.org/x/tools/cmd/goimports \
github.com/mailru/easyjson/easyjson \
github.com/valyala/quicktemplate/qtc
2017-06-17 00:56:52 +00:00
date +%s > .last
fi
set -ve
2017-01-24 15:09:23 +00:00
go generate
gofmt -w -s templates/*.go
2017-01-24 15:09:23 +00:00
go build
time ./chromedp-gen $@
2017-01-24 15:09:23 +00:00
go install ../../cdp/...