install: check terraform command exit status
Check if the terraform command that was run exited with without errors
if not then return from there itself with exit status.
@@ -28,7 +28,16 @@ func executeTerraform(ex *Executor, args ...string) error {
}()
<-done
- return t.Stop()
+
+ if err := t.Stop(); err != nil {
+ return err
+ }
+
+ if _, err := ex.Status(pid); err != nil {
+ return err
+ }
+
+ return nil
}
// InitAndApply create a new terraform executor for the given path,
