mirror of
https://github.com/subosito/flutter-action.git
synced 2024-08-16 10:19:50 +02:00
add unzip for macos
This commit is contained in:
parent
7ba552e43d
commit
c8ce10620f
3 changed files with 28 additions and 2 deletions
|
@ -116,7 +116,12 @@ function extractFile(file, destDir) {
|
|||
yield extractTarXz(file, destDir);
|
||||
}
|
||||
else {
|
||||
yield tc.extractZip(file, destDir);
|
||||
if (IS_DARWIN) {
|
||||
yield extractZipDarwin(file, destDir);
|
||||
}
|
||||
else {
|
||||
yield tc.extractZip(file, destDir);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -148,3 +153,9 @@ function _createExtractFolder(dest) {
|
|||
return dest;
|
||||
});
|
||||
}
|
||||
function extractZipDarwin(file, dest) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const unzipPath = path.join(__dirname, '..', 'scripts', 'externals', 'unzip-darwin');
|
||||
yield exec_1.exec(`"${unzipPath}"`, [file], { cwd: dest });
|
||||
});
|
||||
}
|
||||
|
|
BIN
scripts/externals/unzip-darwin
vendored
Executable file
BIN
scripts/externals/unzip-darwin
vendored
Executable file
Binary file not shown.
|
@ -119,7 +119,11 @@ async function extractFile(file: string, destDir: string): Promise<void> {
|
|||
if ('tar.xz' === extName()) {
|
||||
await extractTarXz(file, destDir);
|
||||
} else {
|
||||
await tc.extractZip(file, destDir);
|
||||
if (IS_DARWIN) {
|
||||
await extractZipDarwin(file, destDir);
|
||||
} else {
|
||||
await tc.extractZip(file, destDir);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -153,3 +157,14 @@ async function _createExtractFolder(dest?: string): Promise<string> {
|
|||
await io.mkdirP(dest);
|
||||
return 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});
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue