Skip to content

Commit 0dbfd36

Browse files
Improve parsing
1 parent c8efcbf commit 0dbfd36

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

mima.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ func main() {
7171
return err
7272
}
7373

74-
// err = provider.Start()
75-
// if err != nil {
76-
// return err
77-
// }
74+
err = provider.Start()
75+
if err != nil {
76+
return err
77+
}
7878
fmt.Println("[MIMA] Success! VPS is starting now... please wait")
7979

8080
// Fetch server info...

parsers/service.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,8 @@ func GetService(fileName string, savesDir string, name string, ip string, passwo
126126
scanner := bufio.NewScanner(f)
127127
for scanner.Scan() {
128128
components := strings.Split(strings.TrimLeft(scanner.Text(), "\t \n"), ":")
129-
130129
switch components[0] {
131-
case "create", "start", "stop", "backup":
130+
case "install_tools", "create_executable", "start_executable", "stop_executable":
132131
current = components[0]
133132
case "exe":
134133
command := Execute{data: strings.TrimLeft(components[1], "\t \n")}
@@ -183,12 +182,16 @@ func (p PutFile) Run(conn *services.Connection) error {
183182
func addToService(current string, command Command, service *Service) {
184183
switch current {
185184
case "install_tools":
185+
fmt.Println("adding install_tools")
186186
service.Commands.InstallTools = append(service.Commands.InstallTools, command)
187187
case "create_executable":
188+
fmt.Println("adding create_executable")
188189
service.Commands.CreateExecutable = append(service.Commands.CreateExecutable, command)
189190
case "start_executable":
191+
fmt.Println("adding start_executable")
190192
service.Commands.StartExecutable = append(service.Commands.StartExecutable, command)
191193
case "stop_executable":
194+
fmt.Println("adding stop_executable")
192195
service.Commands.StopExecutable = append(service.Commands.StopExecutable, command)
193196
}
194197
}

0 commit comments

Comments
 (0)