Minor changes to chromedp-gen/build.sh
This commit is contained in:
parent
74075d513f
commit
57160a279e
1
cmd/chromedp-gen/.gitignore
vendored
Normal file
1
cmd/chromedp-gen/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
.last
|
|
@ -1,10 +1,26 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
set -ve
|
UPDATE=0
|
||||||
go get -u \
|
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/mailru/easyjson/easyjson \
|
||||||
github.com/valyala/quicktemplate/qtc
|
github.com/valyala/quicktemplate/qtc
|
||||||
|
|
||||||
|
date +%s > .last
|
||||||
|
fi
|
||||||
|
|
||||||
|
set -ve
|
||||||
go generate
|
go generate
|
||||||
|
|
||||||
gofmt -w -s templates/*.go
|
gofmt -w -s templates/*.go
|
||||||
|
|
|
@ -19,6 +19,7 @@ const (
|
||||||
DomainConsole DomainType = "Console"
|
DomainConsole DomainType = "Console"
|
||||||
DomainDOM DomainType = "DOM"
|
DomainDOM DomainType = "DOM"
|
||||||
DomainDOMDebugger DomainType = "DOMDebugger"
|
DomainDOMDebugger DomainType = "DOMDebugger"
|
||||||
|
DomainDOMSnapshot DomainType = "DOMSnapshot"
|
||||||
DomainDOMStorage DomainType = "DOMStorage"
|
DomainDOMStorage DomainType = "DOMStorage"
|
||||||
DomainDatabase DomainType = "Database"
|
DomainDatabase DomainType = "Database"
|
||||||
DomainDebugger DomainType = "Debugger"
|
DomainDebugger DomainType = "Debugger"
|
||||||
|
@ -83,6 +84,8 @@ func (dt *DomainType) UnmarshalJSON(buf []byte) error {
|
||||||
*dt = DomainDOM
|
*dt = DomainDOM
|
||||||
case DomainDOMDebugger:
|
case DomainDOMDebugger:
|
||||||
*dt = DomainDOMDebugger
|
*dt = DomainDOMDebugger
|
||||||
|
case DomainDOMSnapshot:
|
||||||
|
*dt = DomainDOMSnapshot
|
||||||
case DomainDOMStorage:
|
case DomainDOMStorage:
|
||||||
*dt = DomainDOMStorage
|
*dt = DomainDOMStorage
|
||||||
case DomainDatabase:
|
case DomainDatabase:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user