MCPcopy
hub / github.com/electerm/electerm / runMac10

Function runMac10

npm/install.js:425–463  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

423}
424
425async function runMac10 () {
426 console.log(' Fetching release info...')
427 const releaseInfo = await getReleaseInfo(r => /mac10-x64\.dmg$/.test(r.name))
428 if (!releaseInfo) {
429 throw new Error('No release found for macOS 10.x')
430 }
431
432 const safeName = sanitizeFilename(releaseInfo.name)
433 const proxyUrl = applyProxy(releaseInfo.browser_download_url)
434 console.log(` URL: ${proxyUrl}`)
435
436 await download(releaseInfo.browser_download_url, packageRoot, { extract: false, displayName: releaseInfo.name })
437
438 const dmgPath = join(packageRoot, safeName)
439 showFinalMessage()
440
441 // Install from DMG automatically
442 try {
443 await installFromDmg(dmgPath)
444
445 // Clean up DMG
446 try {
447 fs.unlinkSync(dmgPath)
448 console.log(' Cleaned up DMG file')
449 } catch (e) {
450 // Ignore cleanup errors
451 }
452
453 console.log('')
454 console.log(' Installation complete! You can now launch electerm from /Applications')
455 } catch (err) {
456 console.error('')
457 console.error(' Warning: Automatic installation failed:', err.message)
458 console.error(' Please manually copy the app from the DMG to /Applications')
459 console.error('')
460 console.log(' Opening DMG for manual installation...')
461 execFile('open', [dmgPath])
462 }
463}
464
465// ---------------------------------------------------------------------------
466// Main

Callers 1

mainFunction · 0.85

Calls 6

applyProxyFunction · 0.85
showFinalMessageFunction · 0.85
installFromDmgFunction · 0.85
getReleaseInfoFunction · 0.70
sanitizeFilenameFunction · 0.70
downloadFunction · 0.70

Tested by

no test coverage detected