mirror of
https://github.com/moby/buildkit.git
synced 2025-10-24 05:52:59 +03:00
24 lines
339 B
Go
24 lines
339 B
Go
//go:build windows
|
|
|
|
package git
|
|
|
|
import (
|
|
"context"
|
|
"os/exec"
|
|
)
|
|
|
|
func runWithStandardUmask(ctx context.Context, cmd *exec.Cmd) error {
|
|
if err := cmd.Start(); err != nil {
|
|
return err
|
|
}
|
|
waitDone := make(chan struct{})
|
|
go func() {
|
|
select {
|
|
case <-ctx.Done():
|
|
cmd.Process.Kill()
|
|
case <-waitDone:
|
|
}
|
|
}()
|
|
return cmd.Wait()
|
|
}
|