@@ -258,8 +258,8 @@ async function downloadVSCodeArchive(options: DownloadOptions) {
258
258
async function unzipVSCode (
259
259
reporter : ProgressReporter ,
260
260
extractDir : string ,
261
- extractSync : boolean ,
262
261
stream : Readable ,
262
+ platform : DownloadPlatform ,
263
263
format : 'zip' | 'tgz'
264
264
) {
265
265
const stagingFile = path . join ( tmpdir ( ) , `vscode-test-${ Date . now ( ) } .zip` ) ;
@@ -306,7 +306,9 @@ async function unzipVSCode(
306
306
fs . mkdirSync ( extractDir ) ;
307
307
}
308
308
309
- await spawnDecompressorChild ( 'tar' , [ '-xzf' , '-' , '--strip-components=1' , '-C' , extractDir ] , stream ) ;
309
+ // The CLI is a singular binary that doesn't have a wrapper component to remove
310
+ const s = platform . includes ( 'cli-' ) ? 0 : 1 ;
311
+ await spawnDecompressorChild ( 'tar' , [ '-xzf' , '-' , `--strip-components=${ s } ` , '-C' , extractDir ] , stream ) ;
310
312
}
311
313
}
312
314
@@ -340,7 +342,6 @@ export async function download(options: Partial<DownloadOptions> = {}): Promise<
340
342
platform = systemDefaultPlatform ,
341
343
cachePath = defaultCachePath ,
342
344
reporter = new ConsoleReporter ( process . stdout . isTTY ) ,
343
- extractSync = false ,
344
345
timeout = 15_000 ,
345
346
} = options ;
346
347
@@ -421,7 +422,7 @@ export async function download(options: Partial<DownloadOptions> = {}): Promise<
421
422
} ) ;
422
423
// important! do not put anything async here, since unzipVSCode will need
423
424
// to start consuming the stream immediately.
424
- await unzipVSCode ( reporter , downloadStaging , extractSync , stream , format ) ;
425
+ await unzipVSCode ( reporter , downloadStaging , stream , platform , format ) ;
425
426
await fs . promises . rename ( downloadStaging , downloadedPath ) ;
426
427
427
428
reporter . report ( { stage : ProgressReportStage . NewInstallComplete , downloadedPath } ) ;
0 commit comments