@@ -237,8 +237,7 @@ async function downloadGDB(target: VsceTarget, dest: string, options?: ToolOptio
237237 'darwin-arm64' : { build : 'darwin-arm64' , ext : 'tar.xz' } ,
238238 } [ target ] ;
239239
240- const asset_name_base = `arm-gnu-toolchain-${ build } -arm-none-eabi-gdb` ;
241- const asset_name = `${ asset_name_base } .${ ext } ` ;
240+ const asset_name = `arm-gnu-toolchain-${ build } -arm-none-eabi-gdb.${ ext } ` ;
242241 const url = `https://artifacts.tools.arm.com/arm-none-eabi-gdb/${ jsonVersion } /${ asset_name } ` ;
243242
244243 const tempfile = await import ( 'tempfile' ) ;
@@ -247,7 +246,6 @@ async function downloadGDB(target: VsceTarget, dest: string, options?: ToolOptio
247246 ? { mode : 'cache' , downloadPath : options . cache }
248247 : { mode : 'temp' , downloadPath : tempfile . default ( ) } ;
249248 const downloadFilePath = path . join ( downloadPath , asset_name ) ;
250- //const downloadFilePathBase = path.join(downloadPath, asset_name_base);
251249
252250 if ( options ?. force === false && mode === 'cache' && existsSync ( downloadFilePath ) ) {
253251 console . debug ( `Found GDB asset in cache ${ downloadFilePath } ...` ) ;
@@ -270,23 +268,21 @@ async function downloadGDB(target: VsceTarget, dest: string, options?: ToolOptio
270268 const fileType = await fileTypeFromFile ( downloadFilePath ) ;
271269 console . debug ( `File type: MIME-type ${ fileType ?. mime } , Extension ${ fileType ?. ext } ...` ) ;
272270
273- // if (fileType?.mime === 'application/zip' || fileType?.ext === 'zip') {
271+ if ( fileType ?. mime === 'application/zip' || fileType ?. ext === 'zip' ) {
274272 console . debug ( `extractZip: dir ${ destPath } ...` ) ;
275273 await extractZip ( downloadFilePath , { dir : destPath , onEntry ( entry , _zipfile ) {
276274 console . debug ( `\tentry ${ entry . fileName } ...` ) ;
277275 } , } ) . catch ( error => {
278276 throw new Error ( `Failed to extract ${ url } ` , { cause : error } ) ;
279277 } ) ;
280- /*
281278 } else {
282279 console . debug ( `fastExtract: downld ${ downloadFilePath } , dest ${ destPath } ...` ) ;
283- await fastExtract(downloadFilePathBase , destPath, { strip: 1, type: fileType?.ext },
280+ await fastExtract ( downloadFilePath , destPath , { strip : 1 , type : 'tgz' } ,
284281
285282 ) . catch ( error => {
286283 throw new Error ( `Failed to extract ${ downloadFilePath } ` , { cause : error } ) ;
287284 } ) ;
288285 }
289- */
290286
291287
292288 // Remove doc directory as it contains duplicate files (names differ only in case)
0 commit comments