diff --git a/lib/installer.js b/lib/installer.js index 0f4a0ee..0150be1 100644 --- a/lib/installer.js +++ b/lib/installer.js @@ -116,7 +116,12 @@ function extractFile(file, destDir) { yield extractTarXz(file, destDir); } else { - yield tc.extractZip(file, destDir); + if (IS_DARWIN) { + yield extractZipDarwin(file, destDir); + } + else { + yield tc.extractZip(file, destDir); + } } }); } @@ -148,3 +153,9 @@ function _createExtractFolder(dest) { return dest; }); } +function extractZipDarwin(file, dest) { + return __awaiter(this, void 0, void 0, function* () { + const unzipPath = path.join(__dirname, '..', 'scripts', 'externals', 'unzip-darwin'); + yield exec_1.exec(`"${unzipPath}"`, [file], { cwd: dest }); + }); +} diff --git a/scripts/externals/unzip-darwin b/scripts/externals/unzip-darwin new file mode 100755 index 0000000..4ef1504 Binary files /dev/null and b/scripts/externals/unzip-darwin differ diff --git a/src/installer.ts b/src/installer.ts index 255e90e..8b05e66 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -119,7 +119,11 @@ async function extractFile(file: string, destDir: string): Promise { if ('tar.xz' === extName()) { await extractTarXz(file, destDir); } else { - await tc.extractZip(file, destDir); + if (IS_DARWIN) { + await extractZipDarwin(file, destDir); + } else { + await tc.extractZip(file, destDir); + } } } @@ -153,3 +157,14 @@ async function _createExtractFolder(dest?: string): Promise { await io.mkdirP(dest); return dest; } + +async function extractZipDarwin(file: string, dest: string): Promise { + const unzipPath = path.join( + __dirname, + '..', + 'scripts', + 'externals', + 'unzip-darwin' + ); + await exec(`"${unzipPath}"`, [file], {cwd: dest}); +}