From 3965960661db13d3a4fdbfba3ab771d06ee99064 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Sat, 28 Jul 2018 14:03:31 +0800 Subject: [PATCH] feat: Add env --- plugin.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugin.go b/plugin.go index 0b662a2..2a38a1d 100644 --- a/plugin.go +++ b/plugin.go @@ -133,12 +133,11 @@ func (p *Plugin) Exec() error { for _, c := range commands { c.Stdout = os.Stdout c.Stderr = os.Stderr + c.Env = os.Environ() err := c.Run() if err != nil { - logrus.WithFields(logrus.Fields{ - "error": err, - }).Fatal("Failed to execute a command") + return err } logrus.Debug("Command completed successfully") }