diff --git a/backup.go b/backup.go index 7d4ea89..c90406e 100644 --- a/backup.go +++ b/backup.go @@ -7,7 +7,7 @@ import ( "time" ) -func backUp(cmd string, c GoConfig) { +func backUp(cmd string, c UsrConfig) { switch cmd { case "full": fmt.Println("Starting full server backup") diff --git a/cli.go b/cli.go index 8098850..c68e597 100644 --- a/cli.go +++ b/cli.go @@ -19,9 +19,7 @@ func cliToolMode() { startStopServer("stop", c) } case "help", "h", "--help", "-h": - fmt.Printf("Start Server: %s start\nStop Server: %s stop\n", os.Args[0], os.Args[0]) - fmt.Printf("Run backup\n\tFull backup: %s backup full", os.Args[0]) - fmt.Printf("\n\tBackup saves: %s backup saves\n", os.Args[0]) + fmt.Printf("Start Server: %s start\nStop Server: %s stop\nRun backup\n\tFull backup: %s backup full\n\tBackup saves: %s backup saves\n", os.Args[0], os.Args[0], os.Args[0], os.Args[0]) case "download": if len(os.Args) > 2 { switch os.Args[2] { diff --git a/config.go b/config.go index f142876..032838b 100644 --- a/config.go +++ b/config.go @@ -9,14 +9,14 @@ import ( "gopkg.in/yaml.v3" ) -func readCfg(factCfg string) GoConfig { +func readCfg(factCfg string) UsrConfig { //read config file (YAML) fileBytes, err := os.ReadFile(factCfg) if err != nil { log.Fatalf("Error reading config file: %v", err) } // return Struct - var config GoConfig + var config UsrConfig err = yaml.Unmarshal(fileBytes, &config) if err != nil { log.Fatalf("Error unmarshalling YAML file: %v", err) @@ -32,7 +32,7 @@ func isItReal(path string) bool { //check if path exists return false } } -func verifyConfig(config GoConfig) bool { // check each file/dir to see if it exists +func verifyConfig(config UsrConfig) bool { // check each file/dir to see if it exists if !isItReal(config.Server.ServDir) { //check for Server directory fmt.Printf("PATH NOT FOUND: %s", config.Server.ServDir) return false diff --git a/factoryman b/factoryman index 3cd3f3d..cf82948 100755 Binary files a/factoryman and b/factoryman differ diff --git a/launchserver.go b/launchserver.go index 7ecef79..9acc2ef 100644 --- a/launchserver.go +++ b/launchserver.go @@ -7,7 +7,7 @@ import ( "os/exec" ) -func startStopServer(cmd string, con GoConfig) { +func startStopServer(cmd string, con UsrConfig) { switch cmd { case "start": x := fmt.Sprintf("%s --port %d --server-settings %s --start-server %s", con.Server.ServExec, con.Server.ServPort, con.Server.ServCfg, con.Server.WorldFile) diff --git a/structs.go b/structs.go index e2fbc3c..9967720 100644 --- a/structs.go +++ b/structs.go @@ -1,7 +1,7 @@ package main // config struct -type GoConfig struct { +type UsrConfig struct { Server struct { // server specific settings ServDir string `yaml:"serverFolder"` WorldFile string `yaml:"worldFile"`