Author SHA1 Message Date
jjbruntonandClaude Opus 5 63b8808a2a 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 <noreply@anthropic.com>
2026-08-31 11:04:55 +01:00
+5 -1
View File
@@ -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();