1
0
Fork 0
mirror of https://github.com/subosito/flutter-action.git synced 2024-08-16 10:19:50 +02:00
This commit is contained in:
Alif Rachmawadi 2019-08-13 17:29:45 +07:00
parent 0af74a8592
commit d34b182ed1
No known key found for this signature in database
GPG key ID: 79DA63C0F3A55BB1
2 changed files with 6 additions and 14 deletions

View file

@ -107,15 +107,11 @@ function extractFile(file, destDir) {
else if (stats.isDirectory()) {
throw new Error(`Failed to extract ${file} - it is a directory`);
}
const ext = extName();
if ('tar.xz' === ext) {
yield tc.extractTar(file, destDir);
}
else if ('zip' === ext) {
yield tc.extractZip(file, destDir);
if ('tar.xz' === extName()) {
yield tc.extract7z(file, destDir);
}
else {
yield tc.extract7z(file, destDir);
yield tc.extractZip(file, destDir);
}
});
}

View file

@ -114,13 +114,9 @@ async function extractFile(file: string, destDir: string): Promise<void> {
throw new Error(`Failed to extract ${file} - it is a directory`);
}
const ext = extName();
if ('tar.xz' === ext) {
await tc.extractTar(file, destDir);
} else if ('zip' === ext) {
await tc.extractZip(file, destDir);
} else {
if ('tar.xz' === extName()) {
await tc.extract7z(file, destDir);
} else {
await tc.extractZip(file, destDir);
}
}