refactor(recipe): introduce new recipe struct and move some methods

This commit is contained in:
2024-07-07 12:35:09 +02:00
parent 9ef64778f5
commit 950f85e2b4
16 changed files with 197 additions and 167 deletions

View File

@ -72,20 +72,21 @@ You may invoke this command in "wizard" mode and be prompted for input:
BashComplete: autocomplete.RecipeNameComplete,
Action: func(c *cli.Context) error {
recipe := internal.ValidateRecipe(c)
r := recipePkg.Get2(recipe.Name)
if err := recipePkg.EnsureIsClean(recipe.Name); err != nil {
if err := r.EnsureIsClean(); err != nil {
log.Fatal(err)
}
if err := recipePkg.EnsureExists(recipe.Name); err != nil {
if err := r.EnsureExists(); err != nil {
log.Fatal(err)
}
if err := recipePkg.EnsureUpToDate(recipe.Name); err != nil {
if err := r.EnsureUpToDate(); err != nil {
log.Fatal(err)
}
if err := recipePkg.EnsureLatest(recipe.Name); err != nil {
if err := r.EnsureLatest(); err != nil {
log.Fatal(err)
}