Skip to content

Commit

Permalink
fix child process cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
smahmed776 committed Feb 12, 2024
1 parent 4f0dc46 commit 6403c92
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ const exit = (msg) => {
const run = (cmd, cwd) =>
new Promise((resolve, reject) => {
const script = exec(cmd, { encoding: "utf8", stdio: "inherit", cwd });
script.on("message", (data) => log(data.toString()));
script.stdin.on("data", (data) => log(data.toString()));
script.stderr.on("data", (data) => {
log(`Error:: ${data.toString()}`);
});
script.on("error", (err) => {
log(`ERROR:: ${err.message}`);
reject(err);
Expand Down

0 comments on commit 6403c92

Please sign in to comment.