Skip to content

Commit

Permalink
fix keystone build exiting in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dcousens committed Aug 30, 2023
1 parent ca7f452 commit fca0f5c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
4 changes: 1 addition & 3 deletions packages/core/src/scripts/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,7 @@ export async function cli(cwd: string, argv: string[]) {
}

if (command === 'build') {
return build(cwd, defaultFlags(flags, { frozen: false, prisma: true, ui: true })).then(() =>
process.exit(0)
);
return build(cwd, defaultFlags(flags, { frozen: false, prisma: true, ui: true }));
}

if (command === 'start') {
Expand Down
12 changes: 11 additions & 1 deletion packages/core/src/scripts/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
import { cli } from './cli';
import { ExitError } from './utils';

cli(process.cwd(), process.argv.slice(2)).catch(err => {
async function main() {
const argv = process.argv.slice(2);

await cli(process.cwd(), argv)

if (argv[0] === 'build') {
process.exit(0);
}
}

main().catch((err: any) => {
if (err instanceof ExitError) return process.exit(err.code);

console.error(err);
Expand Down

0 comments on commit fca0f5c

Please sign in to comment.