Skip to content

Commit

Permalink
Merge pull request #733 from magieno/2024-11-fix-shell-manager-issue
Browse files Browse the repository at this point in the history
- Adds support for additional event.
  • Loading branch information
etiennenoel authored Dec 9, 2024
2 parents 7c80895 + fda93cb commit a19826e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions packages/cli/src/managers/shell.manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,24 @@ export class ShellManager {
outputStderr && this.consoleManager.writeLine(`Stderr: ${data}`);
});

child.on("error", (error) => {
outputStdout && this.consoleManager.writeLine(`Error: ${error.message}`);

return reject(error);
})

child.on("exit", (code) => {
outputStdout && this.consoleManager.writeLine(`Exit.`);

return resolve(code + "");
})

child.on("disconnect", () => {
outputStdout && this.consoleManager.writeLine(`Disconnect.`);

return reject("Disconnected");
})

child.on('close', (code) => {
outputStdout && this.consoleManager.writeLine(`Command exited with code ${code}`);

Expand Down

0 comments on commit a19826e

Please sign in to comment.