Can't spawn a shell properly using Deno!
I know there is
Deno.run, but I need a way to be able to access the std outputs and errors.I'm really new to Deno, sorry if this is a dumb question.
Deno.runconst bash = (() => {
const bashProc = spawn("bash");
bashProc.stdout.on("data", (data: string) => {
console.log(`stdout: ${data}`);
});
bashProc.stderr.on("data", (err: string) => {
console.error(`stderr: ${err}`);
throw Error(err);
});
bashProc.on("close", (code: string) => {
console.log(`child process exited with code ${code}`);
});
return bashProc.stdin.write;
})();
bash('echo lll');