()
| 13 | } |
| 14 | |
| 15 | function 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 | |
| 32 | function runCommand(command: string, args: string[]) { |
| 33 | return new Promise<void>((resolve, reject) => { |
no outgoing calls
no test coverage detected