-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.go
63 lines (57 loc) · 1.42 KB
/
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package main
import (
"flag"
"fmt"
"log"
"os"
"time"
)
func main() {
if len(os.Args) < 2 {
log.Panic("Must provide a command'\n")
}
command := os.Args[1]
switch command {
case "app-update":
buildFlags := flag.NewFlagSet("user", flag.ExitOnError)
isFullUpdatePtr := buildFlags.Bool(
"full",
false,
"Does a full update instead of just replacing a few files.",
)
skipUpdaterUpdatePtr := buildFlags.Bool(
"skip-updater",
false,
"If not a full update, this will likely be false first which will update the updater and "+
"then re-trigger the new updater in order to update the app.",
)
shouldLaunchPtr := buildFlags.Bool(
"launch",
false,
"If true, will launch Dolphin after update.",
)
isoPathPtr := buildFlags.String(
"iso",
"",
"ISO path to launch when shouldLaunch is true.",
)
versionPtr := buildFlags.String(
"version",
"",
"The current dolphin version we are updating.",
)
buildFlags.Parse(os.Args[2:])
err := execAppUpdate(*isFullUpdatePtr, *skipUpdaterUpdatePtr, *shouldLaunchPtr, *isoPathPtr, *versionPtr)
if err != nil {
fmt.Println("")
fmt.Println("Something went wrong. Read above messages to see if there's additional help info. If Dolphin isn't working, screenshot this and head to the Slippi Discord")
for {
time.Sleep(1 * time.Second)
}
}
case "user-update":
execUserUpdate()
default:
fmt.Println("Command not valid")
}
}