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-12 01:32:38 +00:00
|
|
|
|
2017-06-17 00:56:52 +00:00
|
|
|
date +%s > .last
|
|
|
|
fi
|
|
|
|
|
|
|
|
set -ve
|
2017-01-24 15:09:23 +00:00
|
|
|
go generate
|
|
|
|
|
2017-03-02 03:24:35 +00:00
|
|
|
gofmt -w -s templates/*.go
|
|
|
|
|
2017-01-24 15:09:23 +00:00
|
|
|
go build
|
|
|
|
|
2017-02-09 06:45:44 +00:00
|
|
|
time ./chromedp-gen $@
|
2017-01-24 15:09:23 +00:00
|
|
|
|
|
|
|
go install ../../cdp/...
|