diff --git a/__tests__/externals/zip b/__tests__/externals/zip deleted file mode 100755 index 1bbc48e..0000000 Binary files a/__tests__/externals/zip and /dev/null differ diff --git a/__tests__/externals/zip-darwin b/__tests__/externals/zip-darwin deleted file mode 100755 index 60424b0..0000000 Binary files a/__tests__/externals/zip-darwin and /dev/null differ diff --git a/__tests__/tool-cache.test.ts b/__tests__/tool-cache.test.ts index 35f90be..ff85a20 100644 --- a/__tests__/tool-cache.test.ts +++ b/__tests__/tool-cache.test.ts @@ -287,9 +287,7 @@ describe('@actions/tool-cache', function() { ] await exec.exec(`"${powershellPath}"`, args) } else { - const zipBin: string = - process.platform === 'darwin' ? 'zip-darwin' : 'zip' - const zipPath: string = path.join(__dirname, 'externals', zipBin) + const zipPath: string = await io.which('zip') await exec.exec(`"${zipPath}`, [zipFile, '-r', '.'], {cwd: stagingDir}) } @@ -340,9 +338,7 @@ describe('@actions/tool-cache', function() { ] await exec.exec(`"${powershellPath}"`, args) } else { - const zipBin: string = - process.platform === 'darwin' ? 'zip-darwin' : 'zip' - const zipPath = path.join(__dirname, 'externals', zipBin) + const zipPath: string = await io.which('zip') await exec.exec(zipPath, [zipFile, '-r', '.'], {cwd: stagingDir}) } diff --git a/package-lock.json b/package-lock.json index 9b7e0ed..ffea2aa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@actions/tool-cache", - "version": "1.1.0", + "version": "1.1.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/scripts/externals/unzip b/scripts/externals/unzip deleted file mode 100755 index 4082418..0000000 Binary files a/scripts/externals/unzip and /dev/null differ diff --git a/scripts/externals/unzip-darwin b/scripts/externals/unzip-darwin deleted file mode 100755 index 4ef1504..0000000 Binary files a/scripts/externals/unzip-darwin and /dev/null differ diff --git a/src/tool-cache.ts b/src/tool-cache.ts index 0dd556c..9ab2deb 100644 --- a/src/tool-cache.ts +++ b/src/tool-cache.ts @@ -223,11 +223,7 @@ export async function extractZip(file: string, dest?: string): Promise { if (IS_WINDOWS) { await extractZipWin(file, dest) } else { - if (process.platform === 'darwin') { - await extractZipDarwin(file, dest) - } else { - await extractZipNix(file, dest) - } + await extractZipNix(file, dest) } return dest @@ -255,18 +251,7 @@ async function extractZipWin(file: string, dest: string): Promise { } async function extractZipNix(file: string, dest: string): Promise { - const unzipPath = path.join(__dirname, '..', 'scripts', 'externals', 'unzip') - await exec(`"${unzipPath}"`, [file], {cwd: dest}) -} - -async function extractZipDarwin(file: string, dest: string): Promise { - const unzipPath = path.join( - __dirname, - '..', - 'scripts', - 'externals', - 'unzip-darwin' - ) + const unzipPath = await io.which('unzip') await exec(`"${unzipPath}"`, [file], {cwd: dest}) }