Browse Source

Exit when the user press `ctl+c` when waiting to add the token and press any key to continue for the `share` command

master
Mohammad Fares 4 years ago
parent
commit
d3e2d41be6
  1. 7
      commands/share.js

7
commands/share.js

@ -68,7 +68,12 @@ function getToken(context) {
process.stdin.setRawMode(true);
process.stdin.resume();
process.stdin.once('data', function handler() {
process.stdin.once('data', function handler(data) {
// Check if CTRL+C is pressed to exit
if (data == '\u0003' || data == '\u0003') {
process.exit();
}
console.log(di.chalk.dim('Enjoy !') + '\n');
process.stdin.pause();

Loading…
Cancel
Save