Exit when the user press ctl+c
when waiting to add the token and press any key to continue for the share
command
This commit is contained in:
parent
ed1178a65c
commit
d3e2d41be6
@ -68,7 +68,12 @@ function getToken(context) {
|
|||||||
process.stdin.setRawMode(true);
|
process.stdin.setRawMode(true);
|
||||||
process.stdin.resume();
|
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');
|
console.log(di.chalk.dim('Enjoy !') + '\n');
|
||||||
process.stdin.pause();
|
process.stdin.pause();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user