Skip to content

Commit 95a20d4

Browse files
hdmr14dmwelch
andauthoredOct 20, 2020
fix(cli): Exit CLI with 1(as failed) when received SIGINT (#736)
* fix: Exit process as failed when catch SIGINT. * Exit on SIGINT with correct POSIX value Co-authored-by: David Welch <dmwelch@users.noreply.github.com>
1 parent ba7eeb6 commit 95a20d4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed
 

‎bin/git-cz.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@ var path = require('path');
33
process.on('uncaughtException', function (err) {
44
console.error(err.message || err);
55
process.exit(1);
6-
})
6+
});
7+
8+
// catch SIGINT signal
9+
process.stdin.on('data', function (key) {
10+
if (key == '\u0003') {
11+
process.exit(130); // 128 + SIGINT
12+
}
13+
});
714

815
require('../dist/cli/git-cz.js').bootstrap({
916
cliPath: path.join(__dirname, '../')

0 commit comments

Comments
 (0)
Please sign in to comment.