From c81e3f4db74da8097f89edad0eaf26c7acfb08b6 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 10 Jun 2014 11:34:08 -0700 Subject: [PATCH] command/diff: show diff string output --- command/diff.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/command/diff.go b/command/diff.go index 01226f3ad..58018be42 100644 --- a/command/diff.go +++ b/command/diff.go @@ -42,12 +42,20 @@ func (c *DiffCommand) Run(args []string) int { tfconfig := c.TFConfig tfconfig.Config = b - _, err = terraform.New(tfconfig) + tf, err := terraform.New(tfconfig) if err != nil { c.Ui.Error(fmt.Sprintf("Error initializing Terraform: %s", err)) return 1 } + diff, err := tf.Diff(nil) + if err != nil { + c.Ui.Error(fmt.Sprintf("Error running diff: %s", err)) + return 1 + } + + c.Ui.Output(strings.TrimSpace(diff.String())) + return 0 }