mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-04-01 18:23:16 +08:00
use zip and unzip from path (#161)
This commit is contained in:
@@ -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})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user