@@ -7,23 +7,37 @@ export class InstallCommand implements ICommand {
77 constructor ( private $platformsData : IPlatformsData ,
88 private $platformService : IPlatformService ,
99 private $projectData : IProjectData ,
10- private $projectDataService : IProjectDataService ) { }
10+ private $projectDataService : IProjectDataService ,
11+ private $pluginsService : IPluginsService ,
12+ private $logger : ILogger ) { }
1113
1214 public enableHooks = false ;
1315
1416 public allowedParameters : ICommandParameter [ ] = [ ] ;
1517
1618 public execute ( args : string [ ] ) : IFuture < void > {
1719 return ( ( ) => {
18- this . $projectDataService . initialize ( this . $projectData . projectDir ) ;
20+ let error : string = "" ;
1921
22+ this . $pluginsService . ensureAllDependenciesAreInstalled ( ) . wait ( ) ;
23+
24+ this . $projectDataService . initialize ( this . $projectData . projectDir ) ;
2025 _ . each ( this . $platformsData . platformsNames , platform => {
2126 let platformData = this . $platformsData . getPlatformData ( platform ) ;
2227 let frameworkPackageData = this . $projectDataService . getValue ( platformData . frameworkPackageName ) . wait ( ) ;
2328 if ( frameworkPackageData && frameworkPackageData . version ) {
24- this . $platformService . addPlatforms ( [ `${ platform } @${ frameworkPackageData . version } ` ] ) . wait ( ) ;
29+ try {
30+ this . $platformService . addPlatforms ( [ `${ platform } @${ frameworkPackageData . version } ` ] ) . wait ( ) ;
31+ } catch ( err ) {
32+ error += err ;
33+ }
2534 }
2635 } ) ;
36+
37+ if ( error ) {
38+ this . $logger . error ( error ) ;
39+ }
40+
2741 } ) . future < void > ( ) ( ) ;
2842 }
2943}
0 commit comments