MCPcopy
hub / github.com/electerm/electerm / runMac

Function runMac

npm/install.js:384–423  ·  view source on GitHub ↗
(archName)

Source from the content-addressed store, hash-verified

382}
383
384async 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
425async function runMac10 () {
426 console.log(' Fetching release info...')

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