Changes to API for node-pty

This commit is contained in:
Nathan Byrd
2023-10-10 19:33:25 +00:00
parent 4d70f07fde
commit 577992bbe5
4 changed files with 8 additions and 8 deletions

View File

@@ -208,13 +208,13 @@ module.exports = class ArchiveUtil {
// pty.js doesn't currently give us a error when things fail,
// so we have this horrible, horrible hack:
let err;
proc.once('data', d => {
proc.onData(d => {
if (_.isString(d) && d.startsWith('execvp(3) failed.')) {
err = Errors.ExternalProcess(`${action} failed: ${d.trim()}`);
}
});
proc.once('exit', exitCode => {
proc.onExit(exitCode => {
return cb(
exitCode
? Errors.ExternalProcess(