Skip to content

Commit

Permalink
Hardhat: call process.exit on SIGINT (#616)
Browse files Browse the repository at this point in the history
  • Loading branch information
cgewecke committed Mar 29, 2022
1 parent 7da86b7 commit 2d09f01
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion plugins/hardhat.plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ task("coverage", "Generates a code coverage report for tests")
api = new API(utils.loadSolcoverJS(config));

// Catch interrupt signals
process.on("SIGINT", nomiclabsUtils.finish.bind(null, config, api));
process.on("SIGINT", nomiclabsUtils.finish.bind(null, config, api, true));

// Version Info
ui.report('hardhat-versions', [pkg.version]);
Expand Down
3 changes: 2 additions & 1 deletion plugins/resources/nomiclabs.utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ function tempCacheDir(config){
* @param {SolidityCoverage} api
* @return {Promise}
*/
async function finish(config, api){
async function finish(config, api, shouldKill){
const {
tempContractsDir,
tempArtifactsDir
Expand All @@ -252,6 +252,7 @@ async function finish(config, api){
shell.config.silent = false;

if (api) await api.finish();
if (shouldKill) process.exit(1)
}

module.exports = {
Expand Down

0 comments on commit 2d09f01

Please sign in to comment.