* Run the provided bazel commands on each provided target individually.
(command, targets, present)
| 48 | * Run the provided bazel commands on each provided target individually. |
| 49 | */ |
| 50 | function runBazelCommandOnTargets(command, targets, present) { |
| 51 | for (const target of targets) { |
| 52 | process.stdout.write(`${present}: ${target}`); |
| 53 | const commandResult = spawnSync('pnpm', ['--silent', 'bazel', command, target]); |
| 54 | process.stdout.clearLine(); |
| 55 | process.stdout.cursorTo(0); |
| 56 | if (commandResult.status) { |
| 57 | console.error(`Failed ${command}: ${target}`); |
| 58 | console.group(); |
| 59 | console.error(commandResult.stdout || commandResult.stderr); |
| 60 | console.groupEnd(); |
| 61 | } else { |
| 62 | console.log(`Successful ${command}: ${target}`); |
| 63 | } |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | switch (USER_COMMAND) { |
| 68 | case 'accept': |