mirror of
https://github.com/go-task/task.git
synced 2025-03-19 21:17:46 +02:00
fix(interp): move from deprecated ExecHandler
to the new ExecHandlers
This commit is contained in:
parent
82510a04af
commit
a2f8adbb5c
@ -59,7 +59,7 @@ func RunCommand(ctx context.Context, opts *RunCommandOptions) error {
|
||||
r, err := interp.New(
|
||||
interp.Params(params...),
|
||||
interp.Env(expand.ListEnviron(environ...)),
|
||||
interp.ExecHandler(interp.DefaultExecHandler(15*time.Second)),
|
||||
interp.ExecHandlers(execHandler),
|
||||
interp.OpenHandler(openHandler),
|
||||
interp.StdIO(opts.Stdin, opts.Stdout, opts.Stderr),
|
||||
dirOption(opts.Dir),
|
||||
@ -113,6 +113,10 @@ func Expand(s string) (string, error) {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
func execHandler(next interp.ExecHandlerFunc) interp.ExecHandlerFunc {
|
||||
return interp.DefaultExecHandler(15 * time.Second)
|
||||
}
|
||||
|
||||
func openHandler(ctx context.Context, path string, flag int, perm os.FileMode) (io.ReadWriteCloser, error) {
|
||||
if path == "/dev/null" {
|
||||
return devNull{}, nil
|
||||
|
Loading…
x
Reference in New Issue
Block a user