This commit is contained in:
Aiden McClelland
2025-12-17 12:17:22 -07:00
parent 9567bcec1b
commit e33ab39b85
6 changed files with 48 additions and 25 deletions

View File

@@ -205,11 +205,11 @@ async function runRsync(rsyncOptions: {
const spawned = child_process.spawn(command, args, { detached: true })
let percentage = 0.0
spawned.stdout.on("data", (data: unknown) => {
const lines = String(data).replace("\r", "\n").split("\n")
const lines = String(data).replace(/\r/g, "\n").split("\n")
for (const line of lines) {
const parsed = /$([0-9.]+)%/.exec(line)?.[1]
if (!parsed) {
console.log(parsed)
console.log(line)
continue
}
percentage = Number.parseFloat(parsed)