Skip to content

Commit

Permalink
Show stderr: print to console on demand (fiatjaf#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
yurenchen000 authored Jul 9, 2023
1 parent 6ec5d0a commit f821ca3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions post.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down

0 comments on commit f821ca3

Please sign in to comment.