powershell catch error
This commit is contained in:
parent
3aef4ed544
commit
5bf3819c23
12
lib/util.js
12
lib/util.js
@ -237,9 +237,17 @@ function powerShell(cmd) {
|
||||
child.kill();
|
||||
resolve(result);
|
||||
});
|
||||
child.on('error', function () {
|
||||
child.kill();
|
||||
resolve(result);
|
||||
});
|
||||
|
||||
child.stdin.write(cmd + '\n');
|
||||
child.stdin.end();
|
||||
try {
|
||||
child.stdin.write(cmd + '\n');
|
||||
child.stdin.end();
|
||||
} catch (e) {
|
||||
reject(result)
|
||||
}
|
||||
} else {
|
||||
reject(result);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user