From de040f2bf41dbc42b8ab20c8f04df1382d80ba35 Mon Sep 17 00:00:00 2001 From: Luke Edwards Date: Fri, 28 Aug 2020 14:51:46 -0700 Subject: [PATCH] fix(snowpack): exit process after success (#956) 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. --- snowpack/src/index.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/snowpack/src/index.ts b/snowpack/src/index.ts index 97febfe61b..39652a75bb 100644 --- a/snowpack/src/index.ts +++ b/snowpack/src/index.ts @@ -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) { @@ -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}`);