* Exec a command. * Output will be streamed to the live console. * Returns promise with return code * * @param commandLine command to execute (can include additional args). Must be correctly escaped. * @param args optional arguments for tool. Escaping is handled by
(commandLine, args, options)
| 1673 | * @returns Promise<number> exit code |
| 1674 | */ |
| 1675 | function exec(commandLine, args, options) { |
| 1676 | return __awaiter(this, void 0, void 0, function* () { |
| 1677 | const commandArgs = tr.argStringToArray(commandLine); |
| 1678 | if (commandArgs.length === 0) { |
| 1679 | throw new Error(`Parameter 'commandLine' cannot be null or empty.`); |
| 1680 | } |
| 1681 | // Path to tool to execute should be first arg |
| 1682 | const toolPath = commandArgs[0]; |
| 1683 | args = commandArgs.slice(1).concat(args || []); |
| 1684 | const runner = new tr.ToolRunner(toolPath, args, options); |
| 1685 | return runner.exec(); |
| 1686 | }); |
| 1687 | } |
| 1688 | exports.exec = exec; |
| 1689 | /** |
| 1690 | * Exec a command and get the output. |
no test coverage detected
searching dependent graphs…