1
0
Fork 0

use zip and unzip from path (#161)

pull/157/head^2
Bryan MacFarlane 2019-09-24 17:07:08 -04:00 committed by GitHub
parent 3116829a9b
commit 67eeeea9fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 8 additions and 30 deletions

7
package-lock.json generated
View File

@ -4360,7 +4360,6 @@
"minipass": { "minipass": {
"version": "2.3.5", "version": "2.3.5",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"safe-buffer": "^5.1.2", "safe-buffer": "^5.1.2",
"yallist": "^3.0.0" "yallist": "^3.0.0"
@ -4556,8 +4555,7 @@
}, },
"safe-buffer": { "safe-buffer": {
"version": "5.1.2", "version": "5.1.2",
"bundled": true, "bundled": true
"optional": true
}, },
"safer-buffer": { "safer-buffer": {
"version": "2.1.2", "version": "2.1.2",
@ -4647,8 +4645,7 @@
}, },
"yallist": { "yallist": {
"version": "3.0.3", "version": "3.0.3",
"bundled": true, "bundled": true
"optional": true
} }
} }
}, },

View File

@ -1,6 +1,6 @@
{ {
"name": "@actions/github", "name": "@actions/github",
"version": "1.0.1", "version": "1.1.0",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

Binary file not shown.

View File

@ -287,9 +287,7 @@ describe('@actions/tool-cache', function() {
] ]
await exec.exec(`"${powershellPath}"`, args) await exec.exec(`"${powershellPath}"`, args)
} else { } else {
const zipBin: string = const zipPath: string = await io.which('zip')
process.platform === 'darwin' ? 'zip-darwin' : 'zip'
const zipPath: string = path.join(__dirname, 'externals', zipBin)
await exec.exec(`"${zipPath}`, [zipFile, '-r', '.'], {cwd: stagingDir}) await exec.exec(`"${zipPath}`, [zipFile, '-r', '.'], {cwd: stagingDir})
} }
@ -340,9 +338,7 @@ describe('@actions/tool-cache', function() {
] ]
await exec.exec(`"${powershellPath}"`, args) await exec.exec(`"${powershellPath}"`, args)
} else { } else {
const zipBin: string = const zipPath: string = await io.which('zip')
process.platform === 'darwin' ? 'zip-darwin' : 'zip'
const zipPath = path.join(__dirname, 'externals', zipBin)
await exec.exec(zipPath, [zipFile, '-r', '.'], {cwd: stagingDir}) await exec.exec(zipPath, [zipFile, '-r', '.'], {cwd: stagingDir})
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "@actions/tool-cache", "name": "@actions/tool-cache",
"version": "1.1.0", "version": "1.1.1",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

Binary file not shown.

View File

@ -222,13 +222,9 @@ export async function extractZip(file: string, dest?: string): Promise<string> {
if (IS_WINDOWS) { if (IS_WINDOWS) {
await extractZipWin(file, dest) await extractZipWin(file, dest)
} else {
if (process.platform === 'darwin') {
await extractZipDarwin(file, dest)
} else { } else {
await extractZipNix(file, dest) await extractZipNix(file, dest)
} }
}
return dest return dest
} }
@ -255,18 +251,7 @@ async function extractZipWin(file: string, dest: string): Promise<void> {
} }
async function extractZipNix(file: string, dest: string): Promise<void> { async function extractZipNix(file: string, dest: string): Promise<void> {
const unzipPath = path.join(__dirname, '..', 'scripts', 'externals', 'unzip') const unzipPath = await io.which('unzip')
await exec(`"${unzipPath}"`, [file], {cwd: dest})
}
async function extractZipDarwin(file: string, dest: string): Promise<void> {
const unzipPath = path.join(
__dirname,
'..',
'scripts',
'externals',
'unzip-darwin'
)
await exec(`"${unzipPath}"`, [file], {cwd: dest}) await exec(`"${unzipPath}"`, [file], {cwd: dest})
} }