Added unzip for darwin (#49)

* added unzip for darwin

* add mac builds

* added zip for darwin
This commit is contained in:
Alif Rachmawadi
2019-08-13 23:39:01 +07:00
committed by Danny McCormick
parent eae6c87114
commit 35cd59e8d5
5 changed files with 45 additions and 3 deletions

View File

@@ -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
*