| 63 | } |
| 64 | |
| 65 | function extractTar(tarPath, destDir) { |
| 66 | console.log(`Extracting ${tarPath} → ${destDir}`) |
| 67 | fs.mkdirSync(destDir, { recursive: true }) |
| 68 | // --strip-components=1 removes the top-level "python/" directory from the archive |
| 69 | execSync(`tar -xzf "${tarPath}" --strip-components=1 -C "${destDir}"`, { stdio: 'inherit' }) |
| 70 | if (process.platform === 'darwin') { |
| 71 | try { execSync(`xattr -cr "${destDir}"`) } catch {} |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | // ── Main ────────────────────────────────────────────────────────────────────── |
| 76 | |