Skip to content

Commit c6d1776

Browse files
committed
make sure we pass 'tar.xz' to fast-extract for proper chaining of tar and xz,
leave in 'file-type' for later refinement Signed-off-by: Jens Reinecke <[email protected]>
1 parent 3c82dc5 commit c6d1776

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

scripts/download-tools.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -263,16 +263,12 @@ async function downloadGDB(target: VsceTarget, dest: string, options?: ToolOptio
263263
console.debug(`Extracting ${downloadFilePath} to ${destPath} ...`);
264264
mkdirSync(dest, { recursive: true });
265265

266-
const {fileTypeFromFile} = await import('file-type');
267-
268-
const fileType = await fileTypeFromFile(downloadFilePath);
269-
270-
if (fileType?.mime === 'application/zip' || fileType?.ext === 'zip') {
266+
if (ext === 'zip') {
271267
await extractZip(downloadFilePath, { dir: destPath }).catch(error => {
272268
throw new Error(`Failed to extract ${url}`, { cause: error });
273269
});
274270
} else {
275-
await fastExtract(downloadFilePath, destPath, { strip: 1, type: fileType?.ext }).catch(error => {
271+
await fastExtract(downloadFilePath, destPath, { strip: 1, type: ext }).catch(error => {
276272
throw new Error(`Failed to extract ${downloadFilePath}`, { cause: error });
277273
});
278274
}

0 commit comments

Comments
 (0)