mirror of
https://github.com/iyear/tdl
synced 2025-01-07 03:16:41 +08:00
fix(extension): extension process control lifecycle by self
This commit is contained in:
parent
c19fb820d2
commit
0d574733f2
@ -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
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user