Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,21 @@ var validateCmd = &cobra.Command{
return runValidation(yamlRecipe)
}

// Check if it's a custom recipe name
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we do this in a test case? I guess it's better to not ship if a custom recipe looks broken. 🙂 (I think the validation still makes sense for the local file, like above)

customRecipes, err := playground.GetEmbeddedCustomRecipes()
if err == nil {
for _, cr := range customRecipes {
if cr == recipeName {
yamlRecipe, cleanup, err := playground.LoadCustomRecipe(recipeName, recipes)
if err != nil {
return err
}
defer cleanup()
return runValidation(yamlRecipe)
}
}
}

// Check base recipes
for _, recipe := range recipes {
if recipe.Name() == recipeName {
Expand Down