Merge pull request #489 from NuSkooler/bugfix/node_v20
Updated node-pty to support new node versions
This commit is contained in:
commit
bbfef536e0
|
@ -1,17 +0,0 @@
|
|||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"name": "Launch Program",
|
||||
"skipFiles": [
|
||||
"<node_internals>/**"
|
||||
],
|
||||
"program": "${workspaceFolder}/main.js"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -208,17 +208,17 @@ 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(exitEvent => {
|
||||
return cb(
|
||||
exitCode
|
||||
? Errors.ExternalProcess(
|
||||
`${action} failed with exit code: ${exitCode}`
|
||||
`${action} failed with exit code: ${exitEvent.exitCode}`
|
||||
)
|
||||
: err
|
||||
);
|
||||
|
@ -358,10 +358,10 @@ module.exports = class ArchiveUtil {
|
|||
output += data;
|
||||
});
|
||||
|
||||
proc.once('exit', exitCode => {
|
||||
if (exitCode) {
|
||||
proc.onExit(exitEvent => {
|
||||
if (exitEvent.exitCode) {
|
||||
return cb(
|
||||
Errors.ExternalProcess(`List failed with exit code: ${exitCode}`)
|
||||
Errors.ExternalProcess(`List failed with exit code: ${exitEvent.exitCode}`)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
12
core/door.js
12
core/door.js
|
@ -115,9 +115,10 @@ module.exports = class Door {
|
|||
spawnOptions
|
||||
);
|
||||
|
||||
prePty.once('exit', exitCode => {
|
||||
prePty.onExit(exitEvent => {
|
||||
const {exitCode, signal} = exitEvent;
|
||||
this.client.log.info(
|
||||
{ exitCode: exitCode },
|
||||
{ exitCode, signal },
|
||||
'Door pre-command exited'
|
||||
);
|
||||
return callback(null);
|
||||
|
@ -167,7 +168,7 @@ module.exports = class Door {
|
|||
|
||||
this.doorPty.onData(this.doorDataHandler.bind(this));
|
||||
|
||||
this.doorPty.once('close', () => {
|
||||
this.doorPty.onExit( (/*exitEvent*/) => {
|
||||
return this.restoreIo(this.doorPty);
|
||||
});
|
||||
} else if ('socket' === this.io) {
|
||||
|
@ -180,8 +181,9 @@ module.exports = class Door {
|
|||
);
|
||||
}
|
||||
|
||||
this.doorPty.once('exit', exitCode => {
|
||||
this.client.log.info({ exitCode: exitCode }, 'Door exited');
|
||||
this.doorPty.onExit(exitEvent => {
|
||||
const {exitCode, signal} = exitEvent;
|
||||
this.client.log.info({ exitCode, signal }, 'Door exited');
|
||||
|
||||
if (this.sockServer) {
|
||||
this.sockServer.close();
|
||||
|
|
|
@ -167,17 +167,17 @@ class ScheduledEvent {
|
|||
return cb(e);
|
||||
}
|
||||
|
||||
proc.once('exit', exitCode => {
|
||||
if (exitCode) {
|
||||
proc.onExit(exitEvent => {
|
||||
if (exitEvent.exitCode) {
|
||||
Log.warn(
|
||||
{ eventName: this.name, action: this.action, exitCode: exitCode },
|
||||
{ eventName: this.name, action: this.action, exitCode: exitEvent.exitCode },
|
||||
'Bad exit code while performing scheduled event action'
|
||||
);
|
||||
}
|
||||
return cb(
|
||||
exitCode
|
||||
exitEvent.exitCode
|
||||
? Errors.ExternalProcess(
|
||||
`Bad exit code while performing scheduled event action: ${exitCode}`
|
||||
`Bad exit code while performing scheduled event action: ${exitEvent.exitCode}`
|
||||
)
|
||||
: null
|
||||
);
|
||||
|
|
|
@ -485,13 +485,10 @@ exports.getModule = class TransferFileModule extends MenuModule {
|
|||
}
|
||||
});
|
||||
|
||||
externalProc.once('close', () => {
|
||||
return this.restorePipeAfterExternalProc();
|
||||
});
|
||||
|
||||
externalProc.once('exit', exitCode => {
|
||||
externalProc.onExit(exitEvent => {
|
||||
const {exitCode, signal} = exitEvent;
|
||||
this.client.log.debug(
|
||||
{ cmd: cmd, args: args, exitCode: exitCode },
|
||||
{ cmd: cmd, args: args, exitCode, signal },
|
||||
'Process exited'
|
||||
);
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
"minimist": "^1.2.6",
|
||||
"moment": "2.29.4",
|
||||
"nntp-server": "3.1.0",
|
||||
"node-pty": "0.10.1",
|
||||
"node-pty": "1.0.0",
|
||||
"nodemailer": "6.7.7",
|
||||
"otplib": "11.0.1",
|
||||
"qrcode-generator": "^1.4.4",
|
||||
|
|
Loading…
Reference in New Issue