From 6b982a74864353c1b7d9c509eb93249f1e65496e Mon Sep 17 00:00:00 2001 From: DeskClaw Bot Date: Tue, 21 Apr 2026 16:25:50 +0000 Subject: [PATCH] fix(mobile): make web sync path-independent --- mobile/scripts/sync-web.mjs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mobile/scripts/sync-web.mjs b/mobile/scripts/sync-web.mjs index e7788e590..d626294bd 100644 --- a/mobile/scripts/sync-web.mjs +++ b/mobile/scripts/sync-web.mjs @@ -1,5 +1,6 @@ import { mkdir, readdir, rm, copyFile, stat } from 'node:fs/promises' import { join, resolve } from 'node:path' +import { fileURLToPath } from 'node:url' async function copyDir(srcDir, dstDir) { await mkdir(dstDir, { recursive: true }) @@ -18,9 +19,11 @@ async function copyDir(srcDir, dstDir) { } async function main() { - const repoRoot = resolve(process.cwd(), '..') + const scriptDir = fileURLToPath(new URL('.', import.meta.url)) + const mobileRoot = resolve(scriptDir, '..') + const repoRoot = resolve(mobileRoot, '..') const fromDir = join(repoRoot, 'dist') - const toDir = resolve(process.cwd(), 'www') + const toDir = join(mobileRoot, 'www') const st = await stat(fromDir).catch(() => null) if (!st || !st.isDirectory()) { @@ -35,4 +38,3 @@ main().catch((err) => { console.error(err) process.exit(1) }) -