@onslaughtsnail/caelis 0.0.8 → 0.0.9
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.
- package/package.json +1 -1
- package/scripts/postinstall.mjs +10 -2
package/package.json
CHANGED
package/scripts/postinstall.mjs
CHANGED
|
@@ -95,11 +95,19 @@ async function download(url, toFile, redirects = 0) {
|
|
|
95
95
|
|
|
96
96
|
async function extractArchive(archivePath, tempDir, target) {
|
|
97
97
|
if (target.archiveExt === 'zip') {
|
|
98
|
-
const
|
|
98
|
+
const extractMod = await import('extract-zip');
|
|
99
|
+
const extract = extractMod.default || extractMod;
|
|
100
|
+
if (typeof extract !== 'function') {
|
|
101
|
+
throw new Error('extract-zip module does not export a callable extractor');
|
|
102
|
+
}
|
|
99
103
|
await extract(archivePath, { dir: tempDir });
|
|
100
104
|
return;
|
|
101
105
|
}
|
|
102
|
-
const
|
|
106
|
+
const tarMod = await import('tar');
|
|
107
|
+
const tar = tarMod.default || tarMod;
|
|
108
|
+
if (!tar || typeof tar.x !== 'function') {
|
|
109
|
+
throw new Error('tar module does not export x() extractor');
|
|
110
|
+
}
|
|
103
111
|
await tar.x({
|
|
104
112
|
file: archivePath,
|
|
105
113
|
cwd: tempDir,
|