mirror of
https://git.sr.ht/~cadence/bibliogram
synced 2024-11-22 16:17:29 +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 size = deltas.size
|
||||||
const progress = "=".repeat(i) + " ".repeat(deltas.size-i)
|
const progress = "=".repeat(i) + " ".repeat(deltas.size-i)
|
||||||
const numberLength = String(deltas.size).length
|
const numberLength = String(deltas.size).length
|
||||||
process.stdout.cursorTo(0)
|
if (process.stdout.isTTY) {
|
||||||
|
process.stdout.cursorTo(0)
|
||||||
|
}
|
||||||
process.stdout.write(
|
process.stdout.write(
|
||||||
`Creating database... (${String(i).padStart(numberLength, " ")}`
|
`Creating database... (${String(i).padStart(numberLength, " ")}`
|
||||||
+`/${String(size).padStart(numberLength, " ")}) [${progress}]`
|
+`/${String(size).padStart(numberLength, " ")}) [${progress}]`
|
||||||
)
|
)
|
||||||
|
if (!process.stdout.isTTY) {
|
||||||
|
process.stdout.write("\n")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function createBackup(entry) {
|
async function createBackup(entry) {
|
||||||
|
Loading…
Reference in New Issue
Block a user