diff --git a/packages/cli/src/lib/Installer.ts b/packages/cli/src/lib/Installer.ts index e27e672dc..5710f3e4b 100644 --- a/packages/cli/src/lib/Installer.ts +++ b/packages/cli/src/lib/Installer.ts @@ -244,9 +244,15 @@ export default class Installer { // install flowershow dependencies logWithSpinner({ symbol: "🌸", msg: `Installing Flowershow dependencies` }); try { - const { stdout, stderr } = await execa("npm", ["install"], { + const subprocess = execa("npm", ["install"], { cwd: flowershowDir, }); + + process.on("SIGINT", () => { + subprocess.kill("SIGINT"); + }); + + const { stdout, stderr } = await subprocess; log(stdout); log(stderr); stopSpinner(); diff --git a/packages/cli/src/lib/build.ts b/packages/cli/src/lib/build.ts index 09ad5d7f7..7cd550fab 100644 --- a/packages/cli/src/lib/build.ts +++ b/packages/cli/src/lib/build.ts @@ -16,4 +16,8 @@ export default async function build(dir: string) { const subprocess = execa("npm", ["run", "build"], { cwd: flowershowDir }); subprocess.stdout.pipe(process.stdout); + + process.on("SIGINT", () => { + subprocess.kill("SIGINT"); + }); } diff --git a/packages/cli/src/lib/buildExport.ts b/packages/cli/src/lib/buildExport.ts index cd94968bf..6cae556b8 100644 --- a/packages/cli/src/lib/buildExport.ts +++ b/packages/cli/src/lib/buildExport.ts @@ -9,4 +9,8 @@ export default async function buildExport(dir: string) { const subprocess = execa("npm", ["run", "export"], { cwd: flowershowDir }); subprocess.stdout.pipe(process.stdout); + + process.on("SIGINT", () => { + subprocess.kill("SIGINT"); + }); } diff --git a/packages/cli/src/lib/preview.ts b/packages/cli/src/lib/preview.ts index 26cf2c98e..2f19126e1 100644 --- a/packages/cli/src/lib/preview.ts +++ b/packages/cli/src/lib/preview.ts @@ -17,4 +17,8 @@ export default async function preview(dir: string) { const subprocess = execa("npm", ["run", "dev"], { cwd: flowershowDir }); subprocess.stdout.pipe(process.stdout); + + process.on("SIGINT", () => { + subprocess.kill("SIGINT"); + }); }