fix: bundle

This commit is contained in:
Carlos Florêncio
2026-02-15 23:38:08 +00:00
parent e24f65a133
commit 95f1b2e13b
3 changed files with 26 additions and 1 deletions
+8
View File
@@ -5,6 +5,14 @@ import path from "node:path";
export function extractZip(zipPath: string, destDir: string): void {
const zip = new AdmZip(zipPath);
zip.extractAllTo(destDir, true);
// adm-zip doesn't preserve Unix file permissions, so mark binaries executable
const binDir = path.join(destDir, "kandev", "bin");
if (fs.existsSync(binDir)) {
for (const file of fs.readdirSync(binDir)) {
fs.chmodSync(path.join(binDir, file), 0o755);
}
}
}
export function ensureExtracted(zipPath: string, destDir: string): void {