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