()
| 56 | } |
| 57 | |
| 58 | export async function ensureElectronBinary() { |
| 59 | const binaryPath = tryResolveElectronBinary() |
| 60 | if (binaryPath) { |
| 61 | return binaryPath |
| 62 | } |
| 63 | |
| 64 | console.log('Electron binary missing; installing Electron runtime...') |
| 65 | await runCommand('node', [getElectronInstallScriptPath()]) |
| 66 | |
| 67 | const resolvedBinaryPath = tryResolveElectronBinary() |
| 68 | if (!resolvedBinaryPath) { |
| 69 | throw new Error('Electron binary is still unavailable after installation.') |
| 70 | } |
| 71 | |
| 72 | return resolvedBinaryPath |
| 73 | } |
no test coverage detected