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

Function main

scripts/download-python-embed.js:77–95  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

75// ── Main ──────────────────────────────────────────────────────────────────────
76
77async function main() {
78 fs.mkdirSync(RESOURCES_DIR, { recursive: true })
79
80 const pythonExe = process.platform === 'win32'
81 ? path.join(EMBED_DIR, 'python.exe')
82 : path.join(EMBED_DIR, 'bin', 'python3')
83
84 if (fs.existsSync(pythonExe)) {
85 console.log('python-embed already present, skipping.')
86 return
87 }
88
89 const tarUrl = getPbsUrl()
90 const tarTmp = path.join(RESOURCES_DIR, 'python-embed.tar.gz')
91 await download(tarUrl, tarTmp)
92 extractTar(tarTmp, EMBED_DIR)
93 fs.unlinkSync(tarTmp)
94 console.log('Done. Python standalone extracted.')
95}
96
97main().catch((err) => {
98 console.error('ERROR:', err.message)

Callers 1

Calls 3

getPbsUrlFunction · 0.85
downloadFunction · 0.85
extractTarFunction · 0.85

Tested by

no test coverage detected