refactor: move final rendering into Renderer class
This commit is contained in:
parent
cdfafc9d5f
commit
c1e03f2464
2 changed files with 19 additions and 11 deletions
11
index.ts
11
index.ts
|
|
@ -91,16 +91,9 @@ async function main() {
|
|||
convo.messages.push({ role: "assistant", content: await text });
|
||||
await convoFile.write(JSON.stringify(convo));
|
||||
|
||||
if (!plainOut) {
|
||||
const [width] = process.stdout.getWindowSize();
|
||||
await Bun.spawn({
|
||||
cmd: ["glow", "-w", `${width}`, "-"],
|
||||
stdin: textStream,
|
||||
stdout: "inherit",
|
||||
}).exited;
|
||||
}
|
||||
await renderer.renderFinal(textStream);
|
||||
|
||||
renderer.renderStats(await totalUsage, start, stop);
|
||||
await renderer.renderStats(totalUsage, start, stop);
|
||||
}
|
||||
|
||||
await main();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue