Reverted changes that used bubbletea lib
Fixed some minor issues with backup func added stdout to backup functions added stdout to launchserver functions changed tar execs to add verbos for stdout
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
"time"
|
||||
)
|
||||
|
||||
func startStopServer(cmd string, con GoConfig) {
|
||||
@@ -15,17 +14,11 @@ func startStopServer(cmd string, con GoConfig) {
|
||||
if con.Config.UseScreen { // if screen enabled in confing.yml
|
||||
fmt.Println("Starting factorio server in screen session")
|
||||
startScreenCmd := exec.Command("screen", "-dmS", con.Config.ScreenName, "bash", "-c", x, "; exec sh")
|
||||
//startScreenCmd.Stdout = os.Stdout
|
||||
//startScreenCmd.Stderr = os.Stderr
|
||||
startScreenCmd.Stdout = os.Stdout
|
||||
startScreenCmd.Stderr = os.Stderr
|
||||
err := startScreenCmd.Run()
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to start server: %s", err)
|
||||
} else {
|
||||
fmt.Printf("Started server on port %d, in screen named %s\n", con.Config.ServPort, con.Config.ScreenName)
|
||||
y := exec.Command("screen", "-ls")
|
||||
y.Stdout = os.Stdout
|
||||
y.Stderr = os.Stderr
|
||||
err = y.Run()
|
||||
}
|
||||
} else {
|
||||
startSrvCmd := exec.Command("bash", "-c", x)
|
||||
@@ -43,12 +36,7 @@ func startStopServer(cmd string, con GoConfig) {
|
||||
if err != nil {
|
||||
log.Fatalf("Command failed: %s, Error: %v", quitServerCmd.Args, err)
|
||||
} else {
|
||||
time.Sleep(10 * time.Second)
|
||||
y := exec.Command("screen", "-ls")
|
||||
y.Stdout = os.Stdout
|
||||
y.Stderr = os.Stderr
|
||||
err = y.Run()
|
||||
fmt.Printf("Server in screen %s stopped\n", con.Config.ScreenName)
|
||||
fmt.Println("Server Stopped")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user