use 7z
This commit is contained in:
@@ -107,15 +107,11 @@ function extractFile(file, destDir) {
|
|||||||
else if (stats.isDirectory()) {
|
else if (stats.isDirectory()) {
|
||||||
throw new Error(`Failed to extract ${file} - it is a directory`);
|
throw new Error(`Failed to extract ${file} - it is a directory`);
|
||||||
}
|
}
|
||||||
const ext = extName();
|
if ('tar.xz' === extName()) {
|
||||||
if ('tar.xz' === ext) {
|
yield tc.extract7z(file, destDir);
|
||||||
yield tc.extractTar(file, destDir);
|
|
||||||
}
|
|
||||||
else if ('zip' === ext) {
|
|
||||||
yield tc.extractZip(file, destDir);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
yield tc.extract7z(file, destDir);
|
yield tc.extractZip(file, destDir);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,13 +114,9 @@ async function extractFile(file: string, destDir: string): Promise<void> {
|
|||||||
throw new Error(`Failed to extract ${file} - it is a directory`);
|
throw new Error(`Failed to extract ${file} - it is a directory`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const ext = extName();
|
if ('tar.xz' === extName()) {
|
||||||
|
|
||||||
if ('tar.xz' === ext) {
|
|
||||||
await tc.extractTar(file, destDir);
|
|
||||||
} else if ('zip' === ext) {
|
|
||||||
await tc.extractZip(file, destDir);
|
|
||||||
} else {
|
|
||||||
await tc.extract7z(file, destDir);
|
await tc.extract7z(file, destDir);
|
||||||
|
} else {
|
||||||
|
await tc.extractZip(file, destDir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user