Skip to content

Commit

Permalink
fix: validate undefined variables in initHelp template
Browse files Browse the repository at this point in the history
  • Loading branch information
rchojn authored and rchojn committed Nov 8, 2024
1 parent 9a07770 commit 1a16f70
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/recipe/sauce.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,5 +169,11 @@ func (s *Sauce) RenderInitHelp() (string, error) {
return "", fmt.Errorf("failed to render initHelp template: %w", err)
}

return buf.String(), nil
output := buf.String()

if strings.Contains(output, "<no value>") {
return "", fmt.Errorf("some of the variables used in the initHelp template were undefined")
}

return output, nil
}

0 comments on commit 1a16f70

Please sign in to comment.