(command, args, options = {})
| 1418 | } |
| 1419 | |
| 1420 | function run(command, args, options = {}) { |
| 1421 | const result = spawnSync(command, args, { |
| 1422 | cwd: process.cwd(), |
| 1423 | encoding: "utf8", |
| 1424 | stdio: options.capture ? "pipe" : "inherit", |
| 1425 | }); |
| 1426 | if (result.status !== 0 && !options.allowFailure) { |
| 1427 | const details = options.capture |
| 1428 | ? `\n${result.stderr || result.stdout}` |
| 1429 | : ""; |
| 1430 | throw new Error(`${command} ${args.join(" ")} failed.${details}`); |
| 1431 | } |
| 1432 | return result; |
| 1433 | } |
| 1434 | |
| 1435 | function runText(command, args) { |
| 1436 | const result = run(command, args, { capture: true }); |
no outgoing calls
no test coverage detected