|
|
|
@ -79,12 +79,14 @@ func main() {
|
|
|
|
|
config, err := GetConfig(configPath)
|
|
|
|
|
if err != nil {
|
|
|
|
|
fmt.Fprintf(os.Stderr, err.Error())
|
|
|
|
|
os.Exit(1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
err = smug.Start(config, options, context)
|
|
|
|
|
if err != nil {
|
|
|
|
|
fmt.Println("Oops, an error occurred! Rolling back...")
|
|
|
|
|
smug.Stop(config, options, context)
|
|
|
|
|
os.Exit(1)
|
|
|
|
|
}
|
|
|
|
|
case CommandStop:
|
|
|
|
|
if len(options.Windows) == 0 {
|
|
|
|
@ -95,17 +97,20 @@ func main() {
|
|
|
|
|
config, err := GetConfig(configPath)
|
|
|
|
|
if err != nil {
|
|
|
|
|
fmt.Fprintf(os.Stderr, err.Error())
|
|
|
|
|
os.Exit(1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
err = smug.Stop(config, options, context)
|
|
|
|
|
if err != nil {
|
|
|
|
|
fmt.Fprintf(os.Stderr, err.Error())
|
|
|
|
|
os.Exit(1)
|
|
|
|
|
}
|
|
|
|
|
case CommandNew:
|
|
|
|
|
case CommandEdit:
|
|
|
|
|
err := EditConfig(configPath)
|
|
|
|
|
if err != nil {
|
|
|
|
|
fmt.Fprintf(os.Stderr, err.Error())
|
|
|
|
|
os.Exit(1)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|