From 63b8808a2a3df0bd8017acf94b5545c5e7a2b150 Mon Sep 17 00:00:00 2001 From: jjbrunton Date: Mon, 31 Aug 2026 11:04:55 +0100 Subject: [PATCH] fix(mobile): run OTA publish entrypoint from paths with spaces The entrypoint guard compared process.argv[1] against the pathname of import.meta.url. A URL pathname percent-encodes spaces, so in any checkout whose path contains a space the comparison never matched and main() never ran: every ota:* script exited 0 having done nothing, which is indistinguishable from a successful publish. Compare resolved filesystem paths via fileURLToPath instead. Matches the equivalent guard in the DotActive OTA script. Co-Authored-By: Claude Opus 5 --- apps/mobile/scripts/ota-publish.mjs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/mobile/scripts/ota-publish.mjs b/apps/mobile/scripts/ota-publish.mjs index 0245e39..12909a5 100644 --- a/apps/mobile/scripts/ota-publish.mjs +++ b/apps/mobile/scripts/ota-publish.mjs @@ -3,6 +3,7 @@ import { mkdtempSync, readFileSync, rmSync } from 'node:fs'; import { tmpdir } from 'node:os'; import { join, resolve } from 'node:path'; +import { fileURLToPath } from 'node:url'; import { spawnSync } from 'node:child_process'; const projectDir = resolve(import.meta.dirname, '..'); @@ -140,4 +141,7 @@ export function main(args = process.argv.slice(2), environment = process.env) { run('npx', ['eoas', 'publish', '--branch', branch, ...parsePublishArgs(rawPublishArgs)], exportEnv); } -if (process.argv[1] === new URL(import.meta.url).pathname) main(); +// Compare real filesystem paths: a URL pathname percent-encodes spaces, so +// comparing it to process.argv[1] silently skips main() under any checkout +// whose path contains a space. +if (process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.url)) main();