()
| 75 | // ── Main ────────────────────────────────────────────────────────────────────── |
| 76 | |
| 77 | async 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 | |
| 97 | main().catch((err) => { |
| 98 | console.error('ERROR:', err.message) |
no test coverage detected