-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.go
More file actions
49 lines (42 loc) · 839 Bytes
/
Copy pathmain.go
File metadata and controls
49 lines (42 loc) · 839 Bytes
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
38
39
40
41
42
43
44
45
46
47
48
49
package main
import (
"context"
"embed"
"os"
"catscope/internal/update"
"github.com/wailsapp/wails/v2"
"github.com/wailsapp/wails/v2/pkg/options"
"github.com/wailsapp/wails/v2/pkg/options/assetserver"
)
//go:embed all:frontend/dist
var assets embed.FS
func main() {
handled, err := update.HandleCommandLine(os.Args[1:])
if handled {
if err != nil {
println("CatScope update failed:", err.Error())
os.Exit(1)
}
return
}
update.ScheduleCleanup(os.Args[1:])
app := NewApp()
err = wails.Run(&options.App{
Title: "CatScope",
Width: 1280,
Height: 820,
AssetServer: &assetserver.Options{
Assets: assets,
},
OnStartup: app.startup,
OnShutdown: func(ctx context.Context) {
_ = app.StopLogcat()
},
Bind: []interface{}{
app,
},
})
if err != nil {
println("Error:", err.Error())
}
}