Skip to content

Commit

Permalink
fix: spawn loggers
Browse files Browse the repository at this point in the history
  • Loading branch information
exKAZUu committed Oct 4, 2023
1 parent c00a6c0 commit edaae25
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions packages/wb/src/scripts/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export async function runWithSpawn(
const [printableScript, runnableScript] = normalizeScript(script);
printStart(printableScript);
if (argv.verbose) {
printStart(printableScript, 'Start (detailed)', true);
printStart(runnableScript, 'Start (raw)', true);
}
if (argv.dryRun) {
printFinishedAndExitIfNeeded(printableScript, 0, opts);
Expand Down Expand Up @@ -79,7 +79,10 @@ export function runWithSpawnInParallel(
const [printableScript, runnableScript] = normalizeScript(script);
printStart(printableScript, 'Start (parallel)', true);
if (argv.dryRun) {
printStart(printableScript, 'Start (log)');
printStart(printableScript, 'Started (log)');
if (argv.verbose) {
printStart(runnableScript, 'Started (raw)', true);
}
printFinishedAndExitIfNeeded(printableScript, 0, opts);
return;
}
Expand All @@ -93,7 +96,10 @@ export function runWithSpawnInParallel(
killOnExit: true,
verbose: argv.verbose,
});
printStart(printableScript, 'Start (log)');
printStart(printableScript, 'Started (log)');
if (argv.verbose) {
printStart(runnableScript, 'Started (raw)', true);
}
const out = ret.stdout.trim();
if (out) console.info(out);
printFinishedAndExitIfNeeded(printableScript, ret.status, opts);
Expand Down
2 changes: 1 addition & 1 deletion packages/wb/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function spawnSyncOnExit(command: string): void {
if (killed.has(command)) return;

killed.add(command);
printStart(command, 'Start', true);
printStart(command);
const { status } = spawnSync(command, { cwd: project.dirPath, shell: true, stdio: 'inherit' });
printFinishedAndExitIfNeeded(command, status, {});
};
Expand Down

0 comments on commit edaae25

Please sign in to comment.