(command, commandArgs, options)
| 381 | } |
| 382 | |
| 383 | function runCommand(command, commandArgs, options) { |
| 384 | const { cwd, env, label } = options; |
| 385 | console.log(`> ${label}`); |
| 386 | console.log(` ${[command, ...commandArgs].join(' ')}`); |
| 387 | |
| 388 | const result = spawnSync(command, commandArgs, { |
| 389 | cwd, |
| 390 | env, |
| 391 | stdio: 'inherit', |
| 392 | }); |
| 393 | |
| 394 | if (result.status !== 0) { |
| 395 | fail(`${label} failed with exit code ${result.status || 1}.`); |
| 396 | } |
| 397 | } |
| 398 | |
| 399 | function findNewestHar(rootDir) { |
| 400 | if (!fs.existsSync(rootDir)) { |