refactor: extract text variable and skip empty output
This commit is contained in:
parent
f21f8bb4c7
commit
7bcf5e40ec
1 changed files with 4 additions and 2 deletions
|
|
@ -405,12 +405,14 @@ export const RunCommand = cmd({
|
||||||
|
|
||||||
if (part.type === "text" && part.time?.end) {
|
if (part.type === "text" && part.time?.end) {
|
||||||
if (emit("text", { part })) continue
|
if (emit("text", { part })) continue
|
||||||
|
const text = part.text.trim()
|
||||||
|
if (!text) continue
|
||||||
if (!process.stdout.isTTY) {
|
if (!process.stdout.isTTY) {
|
||||||
process.stdout.write(part.text + EOL)
|
process.stdout.write(text + EOL)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
UI.empty()
|
UI.empty()
|
||||||
UI.println(part.text.trim())
|
UI.println(text)
|
||||||
UI.empty()
|
UI.empty()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue