Skip to content

Commit

Permalink
fix(extension): extension process control lifecycle by self
Browse files Browse the repository at this point in the history
  • Loading branch information
iyear committed Nov 22, 2024
1 parent c19fb82 commit 0d57473
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func NewExtensionCmd(em *extensions.Manager, ext extensions.Extension, stdin io.
Debug: viper.GetBool(consts.FlagDebug),
}

if err = em.Dispatch(ctx, ext, args, env, stdin, stdout, stderr); err != nil {
if err = em.Dispatch(ext, args, env, stdin, stdout, stderr); err != nil {
var execError *exec.ExitError
if errors.As(err, &execError) {
return execError
Expand Down
4 changes: 2 additions & 2 deletions pkg/extensions/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ func (m *Manager) SetClient(client *http.Client) {
m.github = newGhClient(client)
}

func (m *Manager) Dispatch(ctx context.Context, ext Extension, args []string, env *extension.Env, stdin io.Reader, stdout, stderr io.Writer) (rerr error) {
cmd := exec.CommandContext(ctx, ext.Path(), args...)
func (m *Manager) Dispatch(ext Extension, args []string, env *extension.Env, stdin io.Reader, stdout, stderr io.Writer) (rerr error) {
cmd := exec.Command(ext.Path(), args...)

envFile, err := os.CreateTemp("", "*")
if err != nil {
Expand Down

0 comments on commit 0d57473

Please sign in to comment.