-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.go
46 lines (40 loc) · 949 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
38
39
40
41
42
43
44
45
46
package main
import (
"os"
"fmt"
"runtime"
"github.com/leaanthony/restoric/lib"
"github.com/leaanthony/sail/program"
"github.com/leaanthony/mewn"
"github.com/wailsapp/wails"
)
func abort(format string, args ...interface{}) {
fmt.Printf(format+"\n", args...)
os.Exit(1)
}
func main() {
var programName = "restic"
if runtime.GOOS == "windows" {
programName += ".exe"
}
resticBin := program.Find(programName, "Restic")
if resticBin == nil {
abort("Enable to find '%s'. Please make sure it is on your PATH.", programName)
}
restic, err := lib.NewRestic(resticBin)
if err != nil {
abort(err.Error())
}
js := mewn.String("./frontend/dist/app.js")
css := mewn.String("./frontend/dist/app.css")
app := wails.CreateApp(&wails.AppConfig{
Width: 1024,
Height: 768,
Title: "Restoric",
JS: js,
CSS: css,
Colour: "#131313",
})
app.Bind(lib.NewRestoric(restic))
app.Run()
}