wiki-plugin-shoppe 0.0.29 → 0.0.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/server/server.js +7 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wiki-plugin-shoppe",
3
- "version": "0.0.29",
3
+ "version": "0.0.30",
4
4
  "description": "Multi-tenant digital goods shoppe for federated wiki, powered by Sanora",
5
5
  "keywords": [
6
6
  "wiki",
package/server/server.js CHANGED
@@ -678,7 +678,13 @@ async function processArchive(zipPath) {
678
678
  // Use system unzip to stream-extract without loading entire archive into RAM.
679
679
  // AdmZip loads the whole zip into memory upfront, which OOM-kills Node on large archives.
680
680
  try {
681
- execSync(`unzip -o "${zipPath}" -d "${tmpDir}"`, { stdio: 'pipe' });
681
+ const unzipBin = (() => {
682
+ for (const p of ['/usr/bin/unzip', '/bin/unzip', '/usr/local/bin/unzip']) {
683
+ if (fs.existsSync(p)) return p;
684
+ }
685
+ return 'unzip'; // fallback, let it fail with a clear error
686
+ })();
687
+ execSync(`"${unzipBin}" -o "${zipPath}" -d "${tmpDir}"`, { stdio: 'pipe' });
682
688
  } catch (err) {
683
689
  throw new Error(`Failed to extract archive: ${err.stderr ? err.stderr.toString().trim() : err.message}`);
684
690
  }