MCPcopy
hub / github.com/lightningpixel/modly / onLine

Function onLine

electron/main/python-setup.ts:236–249  ·  view source on GitHub ↗
(line: string)

Source from the content-addressed store, hash-verified

234 )
235 let packagesInstalled = 0
236 const onLine = (line: string) => {
237 console.log('[pip]', line)
238 let currentPackage: string | undefined
239 const collectMatch = line.match(/^Collecting (.+?)(?:\s|$)/)
240 if (collectMatch) { packagesInstalled++; currentPackage = collectMatch[1] }
241 const downloadMatch = line.match(/^Downloading (.+?)(?:\s|$)/)
242 if (downloadMatch) currentPackage = `Downloading ${downloadMatch[1]}…`
243 const percent = Math.round(20 + (packagesInstalled / TOTAL_PACKAGES) * 79)
244 win.webContents.send('setup:progress', {
245 step: 'packages',
246 percent: Math.min(percent, 99),
247 currentPackage,
248 })
249 }
250 let buffer = ''
251 proc.stdout?.on('data', (d: Buffer) => {
252 buffer += d.toString()

Callers 1

installRequirementsFunction · 0.85

Calls 1

sendMethod · 0.80

Tested by

no test coverage detected