Skip to content

Commit ea2c1c0

Browse files
committed
Added worked route for user revoking
1 parent 4f90706 commit ea2c1c0

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

classes/Process.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const PROCESS_STATUSES = {
66
IN_PROGRESS: "progress"
77
}
88

9-
function RunProcess(scriptPath, args, isNeedConfirmation=false) {
9+
function RunProcess(scriptPath, args, isNeedConfirmation = false) {
1010
return new Promise((resolve, reject) => {
1111
let status = PROCESS_STATUSES.IN_PROGRESS;
1212

@@ -22,6 +22,13 @@ function RunProcess(scriptPath, args, isNeedConfirmation=false) {
2222

2323
// Listen for script's request for input
2424
child.stdout.on('data', (data) => {
25+
if (isNeedConfirmation) {
26+
// Check if the output contains "Y/n" and respond with 'y'
27+
if (data.toString().includes('[y/N]')) {
28+
child.stdin.write('y');
29+
child.stdin.end()
30+
}
31+
}
2532
console.log(`Script stdout: ${data}`);
2633
});
2734

@@ -36,4 +43,4 @@ function RunProcess(scriptPath, args, isNeedConfirmation=false) {
3643
});
3744
}
3845

39-
module.exports = {RunProcess};
46+
module.exports = { RunProcess };

0 commit comments

Comments
 (0)