WIP: add first run at app rollback command

See coop-cloud/organising#146.
This commit is contained in:
2021-09-08 12:55:33 +02:00
parent 855e9ea26d
commit 3c3d8dc0e7
8 changed files with 132 additions and 44 deletions

View File

@ -92,25 +92,6 @@ var appNewCommand = &cli.Command{
},
}
// getRecipeMeta retrieves the recipe metadata from the recipe catalogue.
func getRecipeMeta(recipeName string) (catalogue.RecipeMeta, error) {
catl, err := catalogue.ReadRecipeCatalogue()
if err != nil {
return catalogue.RecipeMeta{}, err
}
recipeMeta, ok := catl[recipeName]
if !ok {
err := fmt.Errorf("recipe '%s' does not exist?", recipeName)
return catalogue.RecipeMeta{}, err
}
if err := recipePkg.EnsureExists(recipeName); err != nil {
return catalogue.RecipeMeta{}, err
}
return recipeMeta, nil
}
// ensureDomainFlag checks if the domain flag was used. if not, asks the user for it/
func ensureDomainFlag() error {
if domain == "" {
@ -190,7 +171,7 @@ func action(c *cli.Context) error {
logrus.Fatal(err)
}
recipeMeta, err := getRecipeMeta(recipe.Name)
recipeMeta, err := catalogue.GetRecipeMeta(recipe.Name)
if err != nil {
logrus.Fatal(err)
}