mirror of
https://github.com/jjbrunton/Sauci.git
synced 2026-10-31 10:19:43 +00:00
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>
This commit is contained in:
1 parent
2f05e9ae87
commit
63b8808a2a
1 file changed
+5
-1
@@ -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();
|
||||
Reference in new issue
Block a user