mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-04-01 18:23:16 +08:00
Added unzip for darwin (#49)
* added unzip for darwin * add mac builds * added zip for darwin
This commit is contained in:
committed by
Danny McCormick
parent
eae6c87114
commit
35cd59e8d5
@@ -218,7 +218,11 @@ export async function extractZip(file: string, dest?: string): Promise<string> {
|
||||
if (IS_WINDOWS) {
|
||||
await extractZipWin(file, dest)
|
||||
} else {
|
||||
await extractZipNix(file, dest)
|
||||
if (process.platform === 'darwin') {
|
||||
await extractZipDarwin(file, dest)
|
||||
} else {
|
||||
await extractZipNix(file, dest)
|
||||
}
|
||||
}
|
||||
|
||||
return dest
|
||||
@@ -250,6 +254,17 @@ async function extractZipNix(file: string, dest: string): Promise<void> {
|
||||
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})
|
||||
}
|
||||
|
||||
/**
|
||||
* Caches a directory and installs it into the tool cacheDir
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user