v0.0.68
This commit is contained in:
12
cmdext/helper.go
Normal file
12
cmdext/helper.go
Normal file
@@ -0,0 +1,12 @@
|
||||
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()
|
||||
}
|
Reference in New Issue
Block a user