From 4515d853c5a60890b208c13977bfacca8180c620 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=AD=E6=9D=91=E7=A7=80=E4=B8=B8?= Date: Fri, 1 May 2020 14:19:55 +0900 Subject: [PATCH 1/2] fix: Exit process as failed when catch SIGINT. --- bin/git-cz.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bin/git-cz.js b/bin/git-cz.js index af58adb8..a65a1934 100644 --- a/bin/git-cz.js +++ b/bin/git-cz.js @@ -3,7 +3,14 @@ var path = require('path'); process.on('uncaughtException', function (err) { console.error(err.message || err); process.exit(1); -}) +}); + +// catch SIGINT signal +process.stdin.on('data', function (key) { + if (key == '\u0003') { + process.exit(1); + } +}); require('../dist/cli/git-cz.js').bootstrap({ cliPath: path.join(__dirname, '../') From d43746b0ecff717377c018f4af672cc6c6991453 Mon Sep 17 00:00:00 2001 From: David Welch Date: Mon, 14 Sep 2020 09:12:38 -0500 Subject: [PATCH 2/2] Exit on SIGINT with correct POSIX value --- bin/git-cz.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/git-cz.js b/bin/git-cz.js index a65a1934..94e2076c 100644 --- a/bin/git-cz.js +++ b/bin/git-cz.js @@ -8,7 +8,7 @@ process.on('uncaughtException', function (err) { // catch SIGINT signal process.stdin.on('data', function (key) { if (key == '\u0003') { - process.exit(1); + process.exit(130); // 128 + SIGINT } });