Skip to content

Commit

Permalink
- Adds support for additional event.
Browse files Browse the repository at this point in the history
  • Loading branch information
etiennenoel committed Dec 9, 2024
1 parent 2d21dc2 commit fda93cb
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 fda93cb

Please sign in to comment.