MCPcopy
hub / github.com/electerm/electerm / runWin7

Function runWin7

npm/install.js:256–294  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

254}
255
256async function runWin7 () {
257 const rawVer = await getVer()
258 const ver = sanitizeVersion(rawVer)
259
260 console.log(` Version: ${ver}`)
261 console.log(' Target: win7')
262
263 const target = join(packageRoot, `electerm-${ver}-win7`)
264
265 rm('-rf', [target, extractDir])
266 fs.mkdirSync(extractDir, { recursive: true })
267
268 console.log(' Fetching release info...')
269 const releaseInfo = await getReleaseInfo(r => /electerm-\d+\.\d+\.\d+-win7\.tar\.gz$/.test(r.name))
270 if (!releaseInfo) {
271 throw new Error('No release found for Windows 7')
272 }
273
274 const tmpDir = join(packageRoot, '.electerm-tmp')
275 rm('-rf', tmpDir)
276 fs.mkdirSync(tmpDir, { recursive: true })
277
278 const proxyUrl = applyProxy(releaseInfo.browser_download_url)
279 console.log(` URL: ${proxyUrl}`)
280
281 const { filepath } = await download(releaseInfo.browser_download_url, tmpDir, { extract: false, displayName: releaseInfo.name })
282
283 console.log(` Installing to: ${extractDir}`)
284 await extractTarGz(filepath, extractDir, 1)
285
286 rm('-rf', tmpDir)
287
288 const exePath = getElectermExePath()
289 if (!fs.existsSync(exePath)) {
290 throw new Error(`electerm.exe not found at ${exePath} after extraction. Archive may have an unexpected structure.`)
291 }
292
293 showFinalMessage()
294}
295
296/**
297 * Mount a DMG, copy the .app to /Applications, then detach

Callers 1

mainFunction · 0.85

Calls 8

getVerFunction · 0.85
sanitizeVersionFunction · 0.85
applyProxyFunction · 0.85
extractTarGzFunction · 0.85
getElectermExePathFunction · 0.85
showFinalMessageFunction · 0.85
getReleaseInfoFunction · 0.70
downloadFunction · 0.70

Tested by

no test coverage detected