mirror of
https://github.com/denoland/deno.git
synced 2024-11-29 16:30:56 -05:00
fix(doc): update example for sub processes (#9798)
This commit is contained in:
parent
506b321d47
commit
bd961c3bc3
1 changed files with 4 additions and 2 deletions
|
@ -70,11 +70,13 @@ const p = Deno.run({
|
|||
|
||||
const { code } = await p.status();
|
||||
|
||||
// Reading the outputs closes their pipes
|
||||
const rawOutput = await p.output();
|
||||
const rawError = await p.stderrOutput();
|
||||
|
||||
if (code === 0) {
|
||||
const rawOutput = await p.output();
|
||||
await Deno.stdout.write(rawOutput);
|
||||
} else {
|
||||
const rawError = await p.stderrOutput();
|
||||
const errorString = new TextDecoder().decode(rawError);
|
||||
console.log(errorString);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue