From 3d3eefb2fe520d355ef9157d61abd48715a62c3a Mon Sep 17 00:00:00 2001 From: cellarspoon Date: Sun, 19 Dec 2021 22:44:19 +0100 Subject: [PATCH] fix: bail out definitely on that error See https://git.coopcloud.tech/coop-cloud/organising/issues/278. --- cli/internal/validate.go | 3 +++ pkg/recipe/recipe.go | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/cli/internal/validate.go b/cli/internal/validate.go index 7c5896ae..462e023d 100644 --- a/cli/internal/validate.go +++ b/cli/internal/validate.go @@ -28,6 +28,9 @@ func ValidateRecipe(c *cli.Context) recipe.Recipe { recipe, err := recipe.Get(recipeName) if err != nil { if c.Command.Name == "generate" { + if strings.Contains(err.Error(), "missing a compose") { + logrus.Fatal(err) + } logrus.Warn(err) } else { logrus.Fatal(err) diff --git a/pkg/recipe/recipe.go b/pkg/recipe/recipe.go index 32d36e58..6831abff 100644 --- a/pkg/recipe/recipe.go +++ b/pkg/recipe/recipe.go @@ -81,6 +81,10 @@ func Get(recipeName string) (Recipe, error) { return Recipe{}, err } + if len(composeFiles) == 0 { + return Recipe{}, fmt.Errorf("%s is missing a compose.yml or compose.*.yml file?", recipeName) + } + envSamplePath := path.Join(config.ABRA_DIR, "apps", recipeName, ".env.sample") sampleEnv, err := config.ReadEnv(envSamplePath) if err != nil {