goext/cmdext/helper.go

13 lines
235 B
Go
Raw Normal View History

2023-01-29 21:27:55 +01:00
package cmdext
import "time"
func RunCommand(program string, args []string, timeout *time.Duration) (CommandResult, error) {
b := Runner(program)
b = b.Args(args)
if timeout != nil {
b = b.Timeout(*timeout)
}
return b.Run()
}