From c2bea8a4c4aeba440b8a7b043d7ece6343a9d263 Mon Sep 17 00:00:00 2001
From: derfalx <kschneider@falx.tech>
Date: Thu, 08 Jan 2026 01:30:42 +0000
Subject: [PATCH] fix(citation): Language parameter for non en-US settings (#2075)
---
quartz/util/log.ts | 21 +++++++++++++++++----
1 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/quartz/util/log.ts b/quartz/util/log.ts
index 95015ac..cfd8c3f 100644
--- a/quartz/util/log.ts
+++ b/quartz/util/log.ts
@@ -1,18 +1,23 @@
+import truncate from "ansi-truncate"
import readline from "readline"
export class QuartzLogger {
verbose: boolean
private spinnerInterval: NodeJS.Timeout | undefined
private spinnerText: string = ""
+ private updateSuffix: string = ""
private spinnerIndex: number = 0
private readonly spinnerChars = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"]
constructor(verbose: boolean) {
- this.verbose = verbose
+ const isInteractiveTerminal =
+ process.stdout.isTTY && process.env.TERM !== "dumb" && !process.env.CI
+ this.verbose = verbose || !isInteractiveTerminal
}
start(text: string) {
this.spinnerText = text
+
if (this.verbose) {
console.log(text)
} else {
@@ -20,14 +25,22 @@
this.spinnerInterval = setInterval(() => {
readline.clearLine(process.stdout, 0)
readline.cursorTo(process.stdout, 0)
- process.stdout.write(`${this.spinnerChars[this.spinnerIndex]} ${this.spinnerText}`)
+
+ const columns = process.stdout.columns || 80
+ let output = `${this.spinnerChars[this.spinnerIndex]} ${this.spinnerText}`
+ if (this.updateSuffix) {
+ output += `: ${this.updateSuffix}`
+ }
+
+ const truncated = truncate(output, columns)
+ process.stdout.write(truncated)
this.spinnerIndex = (this.spinnerIndex + 1) % this.spinnerChars.length
- }, 100)
+ }, 50)
}
}
updateText(text: string) {
- this.spinnerText = text
+ this.updateSuffix = text
}
end(text?: string) {
--
Gitblit v1.10.0