Reduce npx platform-specific unzip issues (#973)

This commit is contained in:
Solomon
2025-10-09 12:37:22 +01:00
committed by GitHub
parent 0253880f0a
commit 3493503602
2 changed files with 20 additions and 5 deletions

View File

@@ -1,6 +1,7 @@
#!/usr/bin/env node
const { execSync, spawn } = require("child_process");
const AdmZip = require("adm-zip");
const path = require("path");
const fs = require("fs");
@@ -88,11 +89,22 @@ function extractAndRun(baseName, launch) {
}
// extract
const unzipCmd =
platform === "win32"
? `powershell -Command "Expand-Archive -Path '${zipPath}' -DestinationPath '${extractDir}' -Force"`
: `unzip -qq -o "${zipPath}" -d "${extractDir}"`;
execSync(unzipCmd, { stdio: "inherit" });
try {
const zip = new AdmZip(zipPath);
zip.extractAllTo(extractDir, true);
} catch (err) {
console.error("❌ Failed to extract vibe-kanban archive:", err.message);
if (process.env.VIBE_KANBAN_DEBUG) {
console.error(err.stack);
}
process.exit(1);
}
if (!fs.existsSync(binPath)) {
console.error(`❌ Extracted binary not found at: ${binPath}`);
console.error("This usually indicates a corrupt download. Please reinstall the package.");
process.exit(1);
}
// perms & launch
if (platform !== "win32") {

View File

@@ -10,6 +10,9 @@
"author": "bloop",
"license": "",
"description": "NPX wrapper around vibe-kanban and vibe-kanban-mcp",
"dependencies": {
"adm-zip": "^0.5.16"
},
"files": [
"dist",
"bin"