From c721ad78838dfffea8ed1df24caeb3a0fc1c1e85 Mon Sep 17 00:00:00 2001 From: Guy Bedford Date: Thu, 17 Jan 2019 17:01:45 +0200 Subject: [PATCH] fixup signal handling for ncc run --- src/cli.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/cli.js b/src/cli.js index 6de6a614..cbc71ec0 100755 --- a/src/cli.js +++ b/src/cli.js @@ -236,7 +236,13 @@ switch (args._[0]) { ? ["-r", resolve(__dirname, "sourcemap-register")] : [] }); - ps.on("close", () => require("rimraf").sync(outDir)); + function exit () { + require("rimraf").sync(outDir); + process.exit(); + } + ps.on("exit", exit); + process.on("SIGTERM", exit); + process.on("SIGINT", exit); } } if (args["--watch"]) {