Bound subprocess output teardown

This commit is contained in:
2026-11-02 03:14:59 +00:00
parent 94aedacf05
commit 9c02ed769b
4 changed files with 101 additions and 10 deletions

View File

@@ -11,6 +11,7 @@ import (
"sort"
"strings"
"sync"
"time"
)
// Invocation describes one child process. UnsetEnv removes inherited values
@@ -135,6 +136,7 @@ func newCommand(ctx context.Context, invocation Invocation) (*exec.Cmd, error) {
}
command := exec.CommandContext(ctx, invocation.Args[0], invocation.Args[1:]...)
command.Dir = invocation.Dir
command.WaitDelay = time.Second
if len(invocation.Env) != 0 || len(invocation.UnsetEnv) != 0 {
command.Env = environmentEntries(invocation.Env, invocation.UnsetEnv)
}