mirror of
https://git.sr.ht/~cadence/bibliogram
synced 2024-11-22 08:07:30 +00:00
Database upgrade code does not require a tty
This commit is contained in:
parent
f252233f47
commit
f37d5bade3
@ -110,11 +110,16 @@ function writeProgress(i) {
|
||||
const size = deltas.size
|
||||
const progress = "=".repeat(i) + " ".repeat(deltas.size-i)
|
||||
const numberLength = String(deltas.size).length
|
||||
if (process.stdout.isTTY) {
|
||||
process.stdout.cursorTo(0)
|
||||
}
|
||||
process.stdout.write(
|
||||
`Creating database... (${String(i).padStart(numberLength, " ")}`
|
||||
+`/${String(size).padStart(numberLength, " ")}) [${progress}]`
|
||||
)
|
||||
if (!process.stdout.isTTY) {
|
||||
process.stdout.write("\n")
|
||||
}
|
||||
}
|
||||
|
||||
async function createBackup(entry) {
|
||||
|
Loading…
Reference in New Issue
Block a user