From f821ca354b1103895147b2bddf8ee66b944a8f0d Mon Sep 17 00:00:00 2001 From: yurenchen000 Date: Sun, 9 Jul 2023 18:29:52 +0800 Subject: [PATCH] Show stderr: print to console on demand (#29) --- post.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/post.js b/post.js index d0f05a6..e297393 100644 --- a/post.js +++ b/post.js @@ -27,6 +27,10 @@ function raw(jsonstring, filter, flags) { FS.streams[1] = FS.open('/dev/stdout', 577, 0) FS.streams[2] = FS.open('/dev/stderr', 577, 0) + if (errBuffer.length) { + console.log('%cstderr%c: %c%s', 'background:red;color:black', '', 'color:red', fromByteArray(errBuffer)) + } + if (outBuffer.length) { return fromByteArray(outBuffer).trim() }