( commandLine: string, args?: string[], options?: im.ExecOptions )
| 12 | * @returns Promise<number> exit code |
| 13 | */ |
| 14 | export async function exec( |
| 15 | commandLine: string, |
| 16 | args?: string[], |
| 17 | options?: im.ExecOptions |
| 18 | ): Promise<number> { |
| 19 | const commandArgs = tr.argStringToArray(commandLine) |
| 20 | if (commandArgs.length === 0) { |
| 21 | throw new Error(`Parameter 'commandLine' cannot be null or empty.`) |
| 22 | } |
| 23 | // Path to tool to execute should be first arg |
| 24 | const toolPath = commandArgs[0] |
| 25 | args = commandArgs.slice(1).concat(args || []) |
| 26 | const runner: tr.ToolRunner = new tr.ToolRunner(toolPath, args, options) |
| 27 | return runner.exec() |
| 28 | } |
no test coverage detected