From c3b52e8fe1e50b7175eee174c1006ad59a952d22 Mon Sep 17 00:00:00 2001 From: syntaxbullet Date: Tue, 8 Sep 2026 16:18:05 +0200 Subject: [PATCH] Resolve backup subprocess paths with URL decoding --- src/ops/backups.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ops/backups.ts b/src/ops/backups.ts index 8a2bc12..ea0d77a 100644 --- a/src/ops/backups.ts +++ b/src/ops/backups.ts @@ -1,3 +1,4 @@ +import { fileURLToPath } from "node:url"; import { Database } from "bun:sqlite"; import { chmodSync, closeSync, constants, copyFileSync, existsSync, fsyncSync, linkSync, mkdirSync, openSync, readdirSync, renameSync, rmSync, statSync, unlinkSync } from "node:fs"; import { dirname, join, resolve } from "node:path"; @@ -86,7 +87,7 @@ export function restoreBackup(source: string, destination: string) { export async function runScheduledBackup(database: string, config: BackupConfig): Promise { const source = new URL("../../scripts/scheduled-backup.ts", import.meta.url); const built = new URL("../scripts/scheduled-backup.ts", import.meta.url); - const script = (existsSync(source) ? source : built).pathname; + const script = fileURLToPath(existsSync(source) ? source : built); const child = Bun.spawn([process.execPath, script, resolve(database), JSON.stringify(config)], { stdout: "pipe", stderr: "ignore", });