Skip to content

Commit

Permalink
fix(snowpack): exit process after success (#956)
Browse files Browse the repository at this point in the history
Ensures that the primary node process is exited, which cleans up any associated child processes spawned by it. Without this, `build` (specifically) can hang indefinitely even though it was successful and Snowpack knows it's complete.
  • Loading branch information
lukeed authored Aug 28, 2020
1 parent 2905af5 commit de040f2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions snowpack/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ export async function cli(args: string[]) {

if (cmd === 'add') {
await addCommand(cliFlags['_'][3], commandOptions);
return;
return process.exit(0);
}
if (cmd === 'rm') {
await rmCommand(cliFlags['_'][3], commandOptions);
return;
return process.exit(0);
}

if (cliFlags['_'].length > 3) {
Expand All @@ -105,15 +105,15 @@ export async function cli(args: string[]) {

if (cmd === 'build') {
await buildCommand(commandOptions);
return;
return process.exit(0);
}
if (cmd === 'dev') {
await devCommand(commandOptions);
return;
return process.exit(0);
}
if (cmd === 'install' || !cmd) {
await installCommand(commandOptions);
return;
return process.exit(0);
}

logger.error(`Unrecognized command: ${cmd}`);
Expand Down

1 comment on commit de040f2

@vercel
Copy link

@vercel vercel bot commented on de040f2 Aug 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.