Skip to content

Commit

Permalink
fix: incorrect exit code for pg/mysql-test run (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
ForbesLindesay authored Feb 15, 2022
1 parent 4ae14d7 commit 7b6081d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
4 changes: 0 additions & 4 deletions packages/mysql-test/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ const command = process.argv[2];
const args = process.argv.slice(3);

const hasHelpFlag = args.includes('--help') || args.includes('-h');
if (hasHelpFlag) {
commands.help();
process.exit(0);
}

switch (command) {
case 'start':
Expand Down
12 changes: 8 additions & 4 deletions packages/mysql-test/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,17 @@ export async function run(args: string[]) {

await runMigrationsAndAddToEnv(databaseURL, parseResult.parsed.debug);

await spawnBuffered(parseResult.rest[0], parseResult.rest.slice(1), {
debug: true,
});
const result = await spawnBuffered(
parseResult.rest[0],
parseResult.rest.slice(1),
{
debug: true,
},
);

await kill();

return 0;
return result.status ?? 0;
}

const stopParams = startChain()
Expand Down
4 changes: 0 additions & 4 deletions packages/pg-test/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ const command = process.argv[2];
const args = process.argv.slice(3);

const hasHelpFlag = args.includes('--help') || args.includes('-h');
if (hasHelpFlag) {
commands.help();
process.exit(0);
}

switch (command) {
case 'start':
Expand Down
12 changes: 8 additions & 4 deletions packages/pg-test/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,17 @@ export async function run(args: string[]) {

await runMigrationsAndAddToEnv(databaseURL, parseResult.parsed.debug);

await spawnBuffered(parseResult.rest[0], parseResult.rest.slice(1), {
debug: true,
});
const result = await spawnBuffered(
parseResult.rest[0],
parseResult.rest.slice(1),
{
debug: true,
},
);

await kill();

return 0;
return result.status ?? 0;
}

const stopParams = startChain()
Expand Down

0 comments on commit 7b6081d

Please sign in to comment.