Skip to content

Commit 7b6081d

Browse files
fix: incorrect exit code for pg/mysql-test run (#227)
1 parent 4ae14d7 commit 7b6081d

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

packages/mysql-test/src/cli.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ const command = process.argv[2];
55
const args = process.argv.slice(3);
66

77
const hasHelpFlag = args.includes('--help') || args.includes('-h');
8-
if (hasHelpFlag) {
9-
commands.help();
10-
process.exit(0);
11-
}
128

139
switch (command) {
1410
case 'start':

packages/mysql-test/src/commands.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,17 @@ export async function run(args: string[]) {
119119

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

122-
await spawnBuffered(parseResult.rest[0], parseResult.rest.slice(1), {
123-
debug: true,
124-
});
122+
const result = await spawnBuffered(
123+
parseResult.rest[0],
124+
parseResult.rest.slice(1),
125+
{
126+
debug: true,
127+
},
128+
);
125129

126130
await kill();
127131

128-
return 0;
132+
return result.status ?? 0;
129133
}
130134

131135
const stopParams = startChain()

packages/pg-test/src/cli.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ const command = process.argv[2];
55
const args = process.argv.slice(3);
66

77
const hasHelpFlag = args.includes('--help') || args.includes('-h');
8-
if (hasHelpFlag) {
9-
commands.help();
10-
process.exit(0);
11-
}
128

139
switch (command) {
1410
case 'start':

packages/pg-test/src/commands.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,17 @@ export async function run(args: string[]) {
117117

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

120-
await spawnBuffered(parseResult.rest[0], parseResult.rest.slice(1), {
121-
debug: true,
122-
});
120+
const result = await spawnBuffered(
121+
parseResult.rest[0],
122+
parseResult.rest.slice(1),
123+
{
124+
debug: true,
125+
},
126+
);
123127

124128
await kill();
125129

126-
return 0;
130+
return result.status ?? 0;
127131
}
128132

129133
const stopParams = startChain()

0 commit comments

Comments
 (0)