// executeStep executes the given step. The returned boolean is to determine if the overall execution of the plan should be aborted or continued
executeStep executes the given step. The returned boolean is to determine if the overall execution of the plan should be aborted or continued
// executeStep executes the given step . The returned boolean is to determine if the overall execution of the plan should be aborted or continued
func executeStep(step model.Step) bool {
	result := step.Execute()
	if !result.WasSuccessful {
		color.Red.Println(result.Message)
		response := "Abort, Continue or Retry?"
		prompt := &survey.Select{
			Message: "",
			Options: []string{"Retry", "Continue", "Abort"},
		}
		survey.AskOne(prompt, &response)
		switch response {
		case "Abort":
			return false
		case "Continue":
			return true
		case "Retry":
			return executeStep(step)
		default:
			log.Printf("Unknown command \"%s\" used after step failed", response)
			return false
		}
	} else {
		return true
	}
}
func executeStep ( step model . Step ) bool { result := step . Execute ( ) if ! result . WasSuccessful { color . Red . Println ( result . Message ) response := " " prompt := & survey . Select { Message : " " , Options : [ ] string { " " , " " , " " } , } survey . AskOne ( prompt , & response ) switch response { case " " : return false case " " : return true case " " : return executeStep ( step ) default : log . Printf ( " \" \" " , response ) return false } } else { return true } }
executeStep executes the given step.
executeStep executes the given step .
// Handle a step failing // Recursively call this method again to try executing it again