Skip to content

Commit

Permalink
added return in startMinecraftServer if error
Browse files Browse the repository at this point in the history
small bug correction
this needs to be improved/expanded
#45
  • Loading branch information
gekigek99 authored Oct 14, 2020
1 parent a2b668c commit d17ce4e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion go-version/minecraft-server-hibernation.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,15 @@ func startMinecraftServer() {
err := exec.Command("/bin/bash", "-c", config.Tomodify.StartMinecraftServerLin).Run()
if err != nil {
log.Printf("stopEmptyMinecraftServer: error starting minecraft server: %v\n", err)
return
}
} else if runtime.GOOS == "windows" {
cmd := exec.Command(strings.Split(config.Tomodify.StartMinecraftServerWin, " ")[0], strings.Split(config.Tomodify.StartMinecraftServerWin, " ")[1:]...)
cmdIn, _ = cmd.StdinPipe()
cmdIn, err := cmd.StdinPipe()
if err != nil {
log.Printf("stopEmptyMinecraftServer: error creating StdinPipe: %v\n", err)
return
}
cmd.Start()
} else {
log.Print("stopEmptyMinecraftServer: error: OS not supported!")
Expand Down

0 comments on commit d17ce4e

Please sign in to comment.