refactor(recipe): use new recipe.Ensure method

This commit is contained in:
2024-07-07 12:46:32 +02:00
parent eee2ecda06
commit 01f3f4be17
10 changed files with 20 additions and 172 deletions

View File

@ -36,28 +36,12 @@ ${FOO:<default>} syntax). "check" does not confirm or deny this for you.`,
BashComplete: autocomplete.AppNameComplete,
Action: func(c *cli.Context) error {
app := internal.ValidateApp(c)
r := recipe.Get2(app.Recipe)
if err := r.EnsureExists(); err != nil {
if err := r.Ensure(internal.Chaos, internal.Offline); err != nil {
log.Fatal(err)
}
if !internal.Chaos {
if err := r.EnsureIsClean(); err != nil {
log.Fatal(err)
}
if !internal.Offline {
if err := r.EnsureUpToDate(); err != nil {
log.Fatal(err)
}
}
if err := r.EnsureLatest(); err != nil {
log.Fatal(err)
}
}
tableCol := []string{"recipe env sample", "app env"}
table := formatter.CreateTable(tableCol)