Fix onExit(): emits a object containing exitCode and signal

This commit is contained in:
Bryan Ashby
2023-10-12 20:21:49 -06:00
parent b87ff51160
commit ca985dd2cb
4 changed files with 21 additions and 18 deletions

View File

@@ -214,11 +214,11 @@ module.exports = class ArchiveUtil {
}
});
proc.onExit(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.onExit(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}`)
);
}