( filePath: string, callback: (err: NodeJS.ErrnoException | null, data: Buffer | undefined) => void )
| 934 | * Read a file from the Electron app bundle (async with callback for compatibility) |
| 935 | */ |
| 936 | export function electronAppReadFile( |
| 937 | filePath: string, |
| 938 | callback: (err: NodeJS.ErrnoException | null, data: Buffer | undefined) => void |
| 939 | ): void { |
| 940 | if (!isElectronAppPath(filePath)) { |
| 941 | callback( |
| 942 | new Error(`[SystemPaths] Access denied: ${filePath} is not within Electron app bundle`), |
| 943 | undefined |
| 944 | ); |
| 945 | return; |
| 946 | } |
| 947 | fsSync.readFile(filePath, callback); |
| 948 | } |
| 949 | |
| 950 | // ============================================================================= |
| 951 | // High-level Tool Detection Methods |
no test coverage detected