Skip to content

Commit 131ea6e

Browse files
authored
Hardhat: call process.exit on SIGINT (#616)
1 parent a743f2e commit 131ea6e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

plugins/hardhat.plugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ task("coverage", "Generates a code coverage report for tests")
9090
api = new API(utils.loadSolcoverJS(config));
9191

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

9595
// Version Info
9696
ui.report('hardhat-versions', [pkg.version]);

plugins/resources/nomiclabs.utils.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ function tempCacheDir(config){
192192
* @param {SolidityCoverage} api
193193
* @return {Promise}
194194
*/
195-
async function finish(config, api){
195+
async function finish(config, api, shouldKill){
196196
const {
197197
tempContractsDir,
198198
tempArtifactsDir
@@ -205,6 +205,7 @@ async function finish(config, api){
205205
shell.config.silent = false;
206206

207207
if (api) await api.finish();
208+
if (shouldKill) process.exit(1)
208209
}
209210

210211
module.exports = {

0 commit comments

Comments
 (0)