Added unzip for darwin (#49)
* added unzip for darwin * add mac builds * added zip for darwin
This commit is contained in:
1 parent
b48642b100
commit
d9d4ce38c9
4 files changed
+22
-3
No files matched your search
BIN
Binary file not shown.
@@ -231,7 +231,9 @@ describe('@actions/tool-cache', function() {
|
|||||||
]
|
]
|
||||||
await exec.exec(`"${powershellPath}"`, args)
|
await exec.exec(`"${powershellPath}"`, args)
|
||||||
} else {
|
} else {
|
||||||
const zipPath: string = path.join(__dirname, 'externals', 'zip')
|
const zipBin: string =
|
||||||
|
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})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -282,7 +284,9 @@ describe('@actions/tool-cache', function() {
|
|||||||
]
|
]
|
||||||
await exec.exec(`"${powershellPath}"`, args)
|
await exec.exec(`"${powershellPath}"`, args)
|
||||||
} else {
|
} else {
|
||||||
const zipPath = path.join(__dirname, 'externals', 'zip')
|
const zipBin: string =
|
||||||
|
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})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
BIN
Binary file not shown.
+16
-1
@@ -218,7 +218,11 @@ 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 {
|
} else {
|
||||||
await extractZipNix(file, dest)
|
if (process.platform === 'darwin') {
|
||||||
|
await extractZipDarwin(file, dest)
|
||||||
|
} else {
|
||||||
|
await extractZipNix(file, dest)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return dest
|
return dest
|
||||||
@@ -250,6 +254,17 @@ async function extractZipNix(file: string, dest: string): Promise<void> {
|
|||||||
await exec(`"${unzipPath}"`, [file], {cwd: dest})
|
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
|
* Caches a directory and installs it into the tool cacheDir
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in new issue
Block a user