fix: rsync progress regex never matched, spamming logs during backup

The regex used `$` (end-of-string anchor) instead of no anchor,
so it never matched the percentage in rsync output. Every line,
including empty ones, was logged instead of parsed.
This commit is contained in:
Aiden McClelland
2026-03-20 17:13:14 -06:00
parent f5bfbe0465
commit c9a93f0a33

View File

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