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": {
"version": "2.3.5",
"bundled": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
@ -4556,8 +4555,7 @@
},
"safe-buffer": {
"version": "5.1.2",
"bundled": true,
"optional": true
"bundled": true
},
"safer-buffer": {
"version": "2.1.2",
@ -4647,8 +4645,7 @@
},
"yallist": {
"version": "3.0.3",
"bundled": true,
"optional": true
"bundled": true
}
}
},

View File

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

Binary file not shown.

View File

@ -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})
}

View File

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

Binary file not shown.

View File

@ -223,11 +223,7 @@ export async function extractZip(file: string, dest?: string): Promise<string> {
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<void> {
}
async function extractZipNix(file: string, dest: string): Promise<void> {
const unzipPath = path.join(__dirname, '..', 'scripts', 'externals', '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'
)
const unzipPath = await io.which('unzip')
await exec(`"${unzipPath}"`, [file], {cwd: dest})
}