func cmdRun(pod *jetpack.Pod) (erv error) { if flAppName.Empty() { if len(pod.Manifest.Apps) != 1 { return errors.New("Multi-app pod! Please use -app=NAME to choose") } else { flAppName = pod.Manifest.Apps[0].Name } } if flDestroy { defer func() { if err := pod.Destroy(); err != nil { if erv == nil { erv = err } else { // TODO: UI fmt.Fprintln(os.Stderr, "ERROR destroying pod:", err) } } }() } return errors.Trace(pod.RunApp(flAppName, nil)) }
func cmdDestroyPod(pod *jetpack.Pod) error { return errors.Trace(pod.Destroy()) }