wait for stdout to finish flushing before exiting

XX probably a better way to do this?
This commit is contained in:
Anton Dyudin 2017-11-30 21:34:57 -08:00
parent ef0724dc90
commit d2d18514f1

View File

@ -7,12 +7,12 @@ term =
.on \data -> process.stdout.write it
term.pipe (new stream-snitch /dojo> /g).on \match ->
console.log "\n\n---\nnode: got dojo!\n---"
set-timeout -> process.exit 0 # should probably test further
console.log "\n\n---\nnode: got dojo!\n---\n\n"
set-timeout (-> process.exit 0), 1000 # should probably test further
term.pipe (new stream-snitch /ford: /g).on \match ->
console.log "\n\n---\nnode: detected error\n---"
set-timeout -> process.exit 1
console.log "\n\n---\nnode: detected error\n---\n\n"
set-timeout (-> process.exit 1), 1000
set-timeout ...
-> console.log "\n\n---\nnode: timed out after 5 min\n---"