Skip to content

Commit

Permalink
feat: add --no-generate flag to stack creation (#742)
Browse files Browse the repository at this point in the history
  • Loading branch information
katcipis committed Dec 7, 2022
1 parent 068a128 commit abebe36
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/terramate/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ type cliSpec struct {
After []string `help:"Add a stack as after"`
Before []string `help:"Add a stack as before"`
IgnoreExisting bool `help:"If the stack already exists do nothing and don't fail"`
NoGenerate bool `help:"Disable code generation for the newly created stack"`
} `cmd:"" help:"Creates a stack on the project"`

Fmt struct {
Expand Down Expand Up @@ -835,6 +836,11 @@ func (c *cli) createStack() {
log.Info().Msgf("created stack %s", stackPath)
c.output.Msg(out.V, "Created stack %s", stackPath)

if c.parsedArgs.Create.NoGenerate {
log.Debug().Msg("code generation on stack creation disabled")
return
}

report, vendorReport := c.gencodeWithVendor()
if report.HasFailures() {
c.output.Msg(out.V, "Code generation failed")
Expand Down

0 comments on commit abebe36

Please sign in to comment.