mirror of
https://github.com/anomalyco/opencode.git
synced 2026-04-24 06:45:22 +00:00
refactor: extract text variable and skip empty output
This commit is contained in:
@@ -405,12 +405,14 @@ export const RunCommand = cmd({
|
||||
|
||||
if (part.type === "text" && part.time?.end) {
|
||||
if (emit("text", { part })) continue
|
||||
const text = part.text.trim()
|
||||
if (!text) continue
|
||||
if (!process.stdout.isTTY) {
|
||||
process.stdout.write(part.text + EOL)
|
||||
process.stdout.write(text + EOL)
|
||||
continue
|
||||
}
|
||||
UI.empty()
|
||||
UI.println(part.text.trim())
|
||||
UI.println(text)
|
||||
UI.empty()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user