Skip to content

Commit

Permalink
Don't print the update plan message if using --json
Browse files Browse the repository at this point in the history
  • Loading branch information
Frassle committed Nov 23, 2022
1 parent 355e07d commit b6d61ec
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
@@ -0,0 +1,4 @@
changes:
- type: fix
scope: cli
description: Don't print update plan message with --json.
18 changes: 10 additions & 8 deletions pkg/cmd/pulumi/preview.go
Expand Up @@ -261,14 +261,16 @@ func newPreviewCmd() *cobra.Command {
return result.FromError(err)
}

// Write out message on how to use the plan
var buf bytes.Buffer
fprintf(&buf, "Update plan written to '%s'", planFilePath)
fprintf(
&buf,
"\nRun `pulumi up --plan='%s'` to constrain the update to the operations planned by this preview",
planFilePath)
cmdutil.Diag().Infof(diag.RawMessage("" /*urn*/, buf.String()))
// Write out message on how to use the plan (if not writing out --json)
if !jsonDisplay {
var buf bytes.Buffer
fprintf(&buf, "Update plan written to '%s'", planFilePath)
fprintf(
&buf,
"\nRun `pulumi up --plan='%s'` to constrain the update to the operations planned by this preview",
planFilePath)
cmdutil.Diag().Infof(diag.RawMessage("" /*urn*/, buf.String()))
}
}
return nil
}
Expand Down

0 comments on commit b6d61ec

Please sign in to comment.