This commit is contained in:
Daisuke Maki 2026-02-14 22:55:48 +09:00
parent e228d8d366
commit 1effee57e9

View file

@ -101,12 +101,11 @@ func (ecf *ExternalCmd) Apply(ctx context.Context, buf []line.Line, out pipeline
return errors.Wrap(err, `failed to start command`)
}
go cmd.Wait()
cmdCh := make(chan line.Line)
go func(ctx context.Context, cmdCh chan line.Line, rdr *bufio.Reader) {
defer func() { recover() }()
defer close(cmdCh)
defer cmd.Wait()
for {
select {
case <-ctx.Done():