-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.go
47 lines (38 loc) · 814 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
47
package main
import (
"fmt"
"github.com/manifoldco/promptui"
)
const (
eu4 = "eu4.exe"
hoi4 = "hoi4.exe"
)
func main() {
prompt := promptui.Select{
Label: "Select game to patch",
Items: []string{
"Europa Universalis IV",
"Hearts of Iron IV",
},
HideHelp: true,
}
_, result, err := prompt.Run()
if err != nil {
fmt.Printf("Prompt failed %v\n", err)
return
}
switch result {
case "Europa Universalis IV":
err = applyPatch(eu4)
case "Hearts of Iron IV":
err = applyPatch(hoi4)
}
if err != nil {
fmt.Println("ERROR:", err)
fmt.Println("Wasn't not installed, file hasn't changed")
} else {
fmt.Println("Patch successfully installed, your original executable has been backuped in [original name].backup")
}
fmt.Println("Press enter to exit")
_, _ = fmt.Scanln()
}