forked from go-rod/rod
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
37 lines (28 loc) · 766 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Package main ...
package main
import (
"path/filepath"
"github.com/Fromsko/rodPro/lib/utils"
)
var slash = filepath.FromSlash
func main() {
build := utils.S(`// Package assets is generated by "lib/assets/generate"
package assets
// MousePointer for rod
const MousePointer = {{.mousePointer}}
// Monitor for rod
const Monitor = {{.monitor}}
// MonitorPage for rod
const MonitorPage = {{.monitorPage}}
`,
"mousePointer", get("../../fixtures/mouse-pointer.svg"),
"monitor", get("monitor.html"),
"monitorPage", get("monitor-page.html"),
)
utils.E(utils.OutputFile(slash("lib/assets/assets.go"), build))
}
func get(path string) string {
code, err := utils.ReadString(slash("lib/assets/" + path))
utils.E(err)
return utils.EscapeGoString(code)
}