MCPcopy Index your code
hub / github.com/lightningpixel/modly / getCertifiBundle

Function getCertifiBundle

electron/main/python-setup.ts:104–121  ·  view source on GitHub ↗
(userData: string)

Source from the content-addressed store, hash-verified

102 * which ship without a CA bundle on Windows.
103 */
104export function getCertifiBundle(userData: string): string | undefined {
105 const venvDir = getVenvDir(userData)
106 // Windows venv layout: Lib/site-packages/certifi/cacert.pem
107 const winPath = join(venvDir, 'Lib', 'site-packages', 'certifi', 'cacert.pem')
108 if (existsSync(winPath)) return winPath
109 // Linux/macOS venv layout: lib/pythonX.Y/site-packages/certifi/cacert.pem
110 const libDir = join(venvDir, 'lib')
111 if (existsSync(libDir)) {
112 try {
113 const { readdirSync } = require('fs') as typeof import('fs')
114 for (const entry of readdirSync(libDir)) {
115 const candidate = join(libDir, entry, 'site-packages', 'certifi', 'cacert.pem')
116 if (existsSync(candidate)) return candidate
117 }
118 } catch { /* ignore */ }
119 }
120 return undefined
121}
122
123export function ensureSslPatch(userData: string): void {
124 if (process.platform !== 'win32') return

Callers

nothing calls this directly

Calls 1

getVenvDirFunction · 0.85

Tested by

no test coverage detected