Skip to content

Commit

Permalink
Merge pull request #48 from Wytamma/main
Browse files Browse the repository at this point in the history
Do not accumulate stdout/err if streaming
  • Loading branch information
robertaboukhalil authored Oct 8, 2024
2 parents 444d22c + 2f68925 commit f9e3abb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -376,26 +376,28 @@ const aioli = {
},
// Setup print functions to store stdout/stderr output
print: text => {
tool.stdout += text + "\n";
if(aioli.config.printStream) {
postMessage({
type: "biowasm",
value: {
stdout: text,
},
});
} else {
tool.stdout += text + "\n";
}
},
printErr: text => {
const destination = aioli.config.printInterleaved ? "stdout" : "stderr";
tool[destination] += text + "\n";
if(aioli.config.printStream) {
postMessage({
type: "biowasm",
value: {
[destination]: text,
},
});
} else {
tool[destination] += text + "\n";
}
}
});
Expand Down

0 comments on commit f9e3abb

Please sign in to comment.