(archName)
| 382 | } |
| 383 | |
| 384 | async function runMac (archName) { |
| 385 | const pattern = new RegExp(`mac-${archName}\\.dmg$`) |
| 386 | console.log(' Fetching release info...') |
| 387 | const releaseInfo = await getReleaseInfo(r => pattern.test(r.name)) |
| 388 | if (!releaseInfo) { |
| 389 | throw new Error(`No release found for Mac ${archName}`) |
| 390 | } |
| 391 | |
| 392 | const safeName = sanitizeFilename(releaseInfo.name) |
| 393 | const proxyUrl = applyProxy(releaseInfo.browser_download_url) |
| 394 | console.log(` URL: ${proxyUrl}`) |
| 395 | |
| 396 | await download(releaseInfo.browser_download_url, packageRoot, { extract: false, displayName: releaseInfo.name }) |
| 397 | |
| 398 | const dmgPath = join(packageRoot, safeName) |
| 399 | showFinalMessage() |
| 400 | |
| 401 | // Install from DMG automatically |
| 402 | try { |
| 403 | await installFromDmg(dmgPath) |
| 404 | |
| 405 | // Clean up DMG |
| 406 | try { |
| 407 | fs.unlinkSync(dmgPath) |
| 408 | console.log(' Cleaned up DMG file') |
| 409 | } catch (e) { |
| 410 | // Ignore cleanup errors |
| 411 | } |
| 412 | |
| 413 | console.log('') |
| 414 | console.log(' Installation complete! You can now launch electerm from /Applications') |
| 415 | } catch (err) { |
| 416 | console.error('') |
| 417 | console.error(' Warning: Automatic installation failed:', err.message) |
| 418 | console.error(' Please manually copy the app from the DMG to /Applications') |
| 419 | console.error('') |
| 420 | console.log(' Opening DMG for manual installation...') |
| 421 | execFile('open', [dmgPath]) |
| 422 | } |
| 423 | } |
| 424 | |
| 425 | async function runMac10 () { |
| 426 | console.log(' Fetching release info...') |
no test coverage detected