Skip to content

Commit

Permalink
wait for shell to complete before refreshing #621
Browse files Browse the repository at this point in the history
  • Loading branch information
matryer committed Mar 11, 2021
1 parent 2aedcfc commit 871a58c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkg/plugins/action.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package plugins

import (
"bytes"
"context"
"fmt"
"os"
Expand Down Expand Up @@ -137,9 +138,14 @@ func actionShell(debugf DebugFunc, item *Item, command string, params []string)
cmd.Dir = filepath.Dir(item.Plugin.Command)
// and it can inherit the environment
cmd.Env = append(cmd.Env, os.Environ()...)
err := cmd.Start()
var stderr bytes.Buffer
cmd.Stderr = &stderr
err := cmd.Run()
if err != nil {
debugf("ERR: action shell: %s", err)
debugf("ERR: action shell: %s", errExec{
err: err,
Stderr: stderr.String(),
})
return
}
}
Expand Down

0 comments on commit 871a58c

Please sign in to comment.