diff --git a/config.go b/config.go index aa0b415..d46801d 100644 --- a/config.go +++ b/config.go @@ -7,8 +7,6 @@ import ( "gopkg.in/yaml.v3" ) -const fmConfig = "config.yml" - type GoConfig struct { Config struct { ServDir string `yaml:"serverFolder"` diff --git a/factoryman b/factoryman index 9f1d808..24abcb9 100755 Binary files a/factoryman and b/factoryman differ diff --git a/main.go b/main.go index 8b50ea8..49548ea 100644 --- a/main.go +++ b/main.go @@ -5,14 +5,10 @@ import ( "os" ) -var c = readCfg(fmConfig) +var c = readCfg("config.yml") -func main() { - if len(os.Args) == 1 { - fmt.Println("Use 'start', 'stop', or 'backup' command") - fmt.Println("ex. factoryman start") - fmt.Println("To configure edit 'conifg.yml'") - } else if len(os.Args) > 1 { +func cli() { + if len(os.Args) > 1 { switch os.Args[1] { case "start": startStopServer("start", c) @@ -44,3 +40,15 @@ func main() { fmt.Println("To configure edit 'conifg.yml'") } } + +func switchMode() { // cli command mode or GUI mode + if len(os.Args) == 1 { + fmt.Println("Starting GUI mode...") + } else if len(os.Args) > 1 { + cli() + } +} + +func main() { + switchMode() +}