Pretty print deployment info map
The current `pulumi env` command just prints the deployment's info map
as-is, which leads to some ugly Go internal map printing output.  Instead
of doing that, let's show a JSON-like map that is properly pretty printed.
package engine
import (
+ "encoding/json"
"fmt"
"github.com/pkg/errors"
@@ -26,7 +27,11 @@ func (eng *Engine) EnvInfo(showIDs bool, showURNs bool) error {
if checkpoint.Latest != nil {
fmt.Fprintf(eng.Stdout, "Last deployment at %v\n", checkpoint.Latest.Time)
if checkpoint.Latest.Info != nil {
- fmt.Fprintf(eng.Stdout, "Additional deployment info: %v\n", checkpoint.Latest.Info)
+ info, err := json.MarshalIndent(checkpoint.Latest.Info, " ", " ")
+ if err != nil {
+ return err
+ }
+ fmt.Fprintf(eng.Stdout, "Additional deployment info:\n %s\n", string(info))
}
}
if target.Config != nil && len(target.Config) > 0 {
