--- a/main.go Thu Dec 28 00:20:47 2017 -0600
+++ b/main.go Sat Dec 30 02:49:57 2017 -0600
@@ -21,6 +21,7 @@
"github.com/alecthomas/kingpin"
@@ -67,12 +68,7 @@
planNames = app.Arg("plan", "The plan or list of plans to run in specified order").Strings()
@@ -99,30 +95,26 @@
// now make sure we found a config file
fmt.Printf("config file not found, looking for %s\n", strings.Join(loader.Filenames(), ","))
// figure out the path to the config file
cfgPath, err := filepath.Abs(filepath.Dir(*configFile))
cfg, err := config.LoadFile(*configFile, loader)
if err := logging.Setup(*color, *verbose); err != nil {
fmt.Printf("failed to setup logging: %s\n", err)
defer gomol.ShutdownLoggers()
@@ -131,8 +123,7 @@
defEnv, err := environment.Initialize(cfgPath)
// if the user specified the shortcut, add * to the list of acceptable keys
@@ -147,7 +138,7 @@
enableSSHAgent, err := ssh.ShouldEnable(*sshIdentities)
cleanupList := cleanup.NewList()
@@ -167,9 +158,7 @@
if err := st.Valid(); err != nil {
var runner runners.Runner
@@ -203,5 +192,17 @@
- exitCode = runner.Run(cfg, realPlans, *env, st)
+ return runner.Run(cfg, realPlans, *env, st) + if r := recover(); r != nil { + fmt.Printf("panic: %s\n%s", r, debug.Stack())