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
|
||||
|
||||
set -ve
|
||||
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
|
||||
|
||||
date +%s > .last
|
||||
fi
|
||||
|
||||
set -ve
|
||||
go generate
|
||||
|
||||
gofmt -w -s templates/*.go
|
||||
|
|
|
@ -19,6 +19,7 @@ const (
|
|||
DomainConsole DomainType = "Console"
|
||||
DomainDOM DomainType = "DOM"
|
||||
DomainDOMDebugger DomainType = "DOMDebugger"
|
||||
DomainDOMSnapshot DomainType = "DOMSnapshot"
|
||||
DomainDOMStorage DomainType = "DOMStorage"
|
||||
DomainDatabase DomainType = "Database"
|
||||
DomainDebugger DomainType = "Debugger"
|
||||
|
@ -83,6 +84,8 @@ func (dt *DomainType) UnmarshalJSON(buf []byte) error {
|
|||
*dt = DomainDOM
|
||||
case DomainDOMDebugger:
|
||||
*dt = DomainDOMDebugger
|
||||
case DomainDOMSnapshot:
|
||||
*dt = DomainDOMSnapshot
|
||||
case DomainDOMStorage:
|
||||
*dt = DomainDOMStorage
|
||||
case DomainDatabase:
|
||||
|
|
Loading…
Reference in New Issue
Block a user