use zip and unzip from path (#161)
This commit is contained in:
1 parent
73e29cfaa1
commit
db534fd20b
7 files changed
+4
-23
No files matched your search
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
@@ -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})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Generated
+1
-1
@@ -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": {
|
||||||
|
|||||||
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
+1
-16
@@ -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})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user