This repository has been archived by the owner on Feb 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
81 lines (61 loc) · 1.5 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package main
import (
"fmt"
"os"
"github.com/DaniruKun/tasukeru/holocure"
"github.com/Songmu/prompter"
)
const Version = "1.1.1"
const HomePage = "https://danpetrov.xyz/tasukeru"
func check(e error) {
if e != nil {
panic(e)
}
}
func waitQuit() {
prompter.YN("press Enter to quit", true)
}
func printHeader() {
header := `
💀 🐔 🐙 🔱 🔎 💎 🪐 🪶 ⏳ 🌿 🎲
Tasukeru - HoloCure save file importer v%s
Made by DaniruKun
- https://github.com/DaniruKun
- https://twitter.com/DaniruKun
Tasukeru Copyright (C) 2022 Daniils Petrovs
This program comes with ABSOLUTELY NO WARRANTY; for details see the Github link.
This is free software, and you are welcome to redistribute it
under certain conditions.
Website: %s
I am not affiliated with Cover Corp. or Kay Yu in any way.
`
fmt.Printf(header, Version, HomePage)
}
func main() {
args := os.Args
if len(args) < 2 {
// Run the UI
RunGUI()
} else {
CLI(args)
}
}
func CLI(args []string) {
printHeader()
var sourceSaveFilePath, targetSaveFilePath string
sourceSaveFilePath = args[1]
if len(args) == 3 {
targetSaveFilePath = args[2]
} else {
targetSaveFilePath = holocure.SaveFilePath()
}
targetDec := holocure.MergeSaves(sourceSaveFilePath, targetSaveFilePath)
fmt.Println()
var confirmed bool = prompter.YN("import new save file? インポートOK?", true)
if confirmed {
err := holocure.WriteSaveFile(targetSaveFilePath, targetDec)
check(err)
fmt.Println("save file imported succesfully!")
waitQuit()
}
}