Skip to content

Commit

Permalink
fixup signal handling for ncc run
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Jan 17, 2019
1 parent 8f8a821 commit 21b47cf
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,15 @@ 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", () => {
require("rimraf").sync(outDir);
});
process.on("SIGTERM", exit);
process.on("SIGINT", exit);
}
}
if (args["--watch"]) {
Expand Down

0 comments on commit 21b47cf

Please # to comment.