This commit is contained in:
2023-01-29 21:27:55 +01:00
parent 34e6d1819d
commit 2070a432a5
3 changed files with 100 additions and 58 deletions

12
cmdext/helper.go Normal file
View 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()
}