MCPcopy Create free account
hub / github.com/IgorWarzocha/howcode / tryResolveElectronBinary

Function tryResolveElectronBinary

scripts/electron-binary.ts:15–30  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13}
14
15function tryResolveElectronBinary() {
16 try {
17 return require('electron') as string
18 } catch (error) {
19 if (
20 error instanceof Error &&
21 (error.message.includes('Electron failed to install correctly') ||
22 ((error as NodeError).code === 'MODULE_NOT_FOUND' &&
23 electronModuleNamePattern.test(error.message)))
24 ) {
25 return null
26 }
27
28 throw error
29 }
30}
31
32function runCommand(command: string, args: string[]) {
33 return new Promise<void>((resolve, reject) => {

Callers 1

ensureElectronBinaryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected