Skip to content

Commit

Permalink
ribosome.js: pipe the stdout/stderr of the spawned process to that of…
Browse files Browse the repository at this point in the history
… the ribosome process

adresses #59
  • Loading branch information
norswap committed Sep 3, 2018
1 parent 605659f commit 8215a86
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions ribosome.js
Original file line number Diff line number Diff line change
Expand Up @@ -630,14 +630,17 @@ if (rnaopt) {
}

if (!rnaopt) {
exec("node " + rnafile + " " + process.argv.slice(3).join(' '),
function(error, stdout, stderr) {
process.stdout.write(stdout);
process.stderr.write(stderr);
fs.unlinkSync(rnafile);

if (error)
process.exit(error.code);
});
}
var proc = exec("node " + rnafile + " " + process.argv.slice(3).join(' '));
proc.stdout.pipe(process.stdout);
proc.stderr.pipe(process.stderr);

proc.on('exit', function (code) {
fs.unlinkSync(rnafile);
process.exit(code);
});

proc.on('error', function (code) {
fs.unlinkSync(rnafile);
process.exit(code);
});
}

0 comments on commit 8215a86

Please sign in to comment.