| 64 | } |
| 65 | |
| 66 | function runPrepareScript() { |
| 67 | const prepareScript = path.join( |
| 68 | projectRoot, |
| 69 | 'scripts/run-prepare-local-update-artifacts.js', |
| 70 | ); |
| 71 | |
| 72 | const result = spawnSync(process.execPath, [prepareScript], { |
| 73 | // Use Node here because the local CLI depends on native addons that are |
| 74 | // built for Node rather than Bun. |
| 75 | cwd: projectRoot, |
| 76 | stdio: 'inherit', |
| 77 | env: process.env, |
| 78 | }); |
| 79 | |
| 80 | if (result.status !== 0) { |
| 81 | throw new Error( |
| 82 | `Failed to prepare local update artifacts, exit code: ${result.status}`, |
| 83 | ); |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | function ensurePreparedArtifacts(platform: string) { |
| 88 | const manifestPath = path.join(artifactsRoot, platform, 'manifest.json'); |