@@ -444,6 +444,16 @@ class DTSManager {
444
444
( i ) => i . name === remoteName ,
445
445
) ;
446
446
447
+ const consumeTypes = async (
448
+ requiredRemoteInfo : Required < RemoteInfo > ,
449
+ ) => {
450
+ const [ _alias , destinationPath ] = await this . consumeTargetRemotes (
451
+ hostOptions ,
452
+ requiredRemoteInfo ,
453
+ ) ;
454
+ await this . downloadAPITypes ( requiredRemoteInfo , destinationPath ) ;
455
+ } ;
456
+
447
457
if ( ! loadedRemoteInfo ) {
448
458
const remoteInfo = Object . values ( mapRemotesToDownload ) . find (
449
459
( item ) => {
@@ -456,20 +466,11 @@ class DTSManager {
456
466
await this . requestRemoteManifest ( remoteInfo ) ;
457
467
this . remoteAliasMap [ remoteInfo . alias ] = requiredRemoteInfo ;
458
468
}
459
- await this . consumeTargetRemotes (
460
- hostOptions ,
461
- this . remoteAliasMap [ remoteInfo . alias ] ,
462
- ) ;
469
+ await consumeTypes ( this . remoteAliasMap [ remoteInfo . alias ] ) ;
463
470
} else if ( updatedRemoteInfo ) {
464
471
const consumeDynamicRemoteTypes = async ( ) => {
465
- const [ _destinationFolder , destinationPath ] =
466
- await this . consumeTargetRemotes (
467
- hostOptions ,
468
- this . updatedRemoteInfos [ updatedRemoteInfo . name ] ,
469
- ) ;
470
- await this . downloadAPITypes (
472
+ await consumeTypes (
471
473
this . updatedRemoteInfos [ updatedRemoteInfo . name ] ,
472
- destinationPath ,
473
474
) ;
474
475
this . consumeAPITypes ( hostOptions ) ;
475
476
} ;
@@ -498,7 +499,7 @@ class DTSManager {
498
499
}
499
500
}
500
501
} else {
501
- await this . consumeTargetRemotes ( hostOptions , loadedRemoteInfo ) ;
502
+ await consumeTypes ( loadedRemoteInfo ) ;
502
503
}
503
504
}
504
505
} catch ( err ) {
0 commit comments