@@ -5,7 +5,9 @@ export class UpdateCommand implements ICommand {
5
5
constructor (
6
6
private $projectData : IProjectData ,
7
7
private $platformService : IPlatformService ,
8
+ private $platformsData : IPlatformsData ,
8
9
private $pluginsService : IPluginsService ,
10
+ private $projectDataService : IProjectDataService ,
9
11
private $logger : ILogger ,
10
12
private $options : IOptions ,
11
13
private $errors : IErrors ) { }
@@ -51,6 +53,18 @@ export class UpdateCommand implements ICommand {
51
53
52
54
private executeCore ( args : string [ ] , folders : string [ ] ) {
53
55
let platforms = this . $platformService . getInstalledPlatforms ( ) . wait ( ) ;
56
+ let availablePlatforms = this . $platformService . getAvailablePlatforms ( ) . wait ( ) ;
57
+ let packagePlatforms : string [ ] = [ ] ;
58
+
59
+ this . $projectDataService . initialize ( this . $projectData . projectDir ) ;
60
+ for ( let platform of availablePlatforms ) {
61
+ let platformData = this . $platformsData . getPlatformData ( platform ) ;
62
+ let platformVersion = this . $projectDataService . getValue ( platformData . frameworkPackageName ) . wait ( ) ;
63
+ if ( platformVersion ) {
64
+ packagePlatforms . push ( platform ) ;
65
+ this . $projectDataService . removeProperty ( platformData . frameworkPackageName ) . wait ( ) ;
66
+ }
67
+ }
54
68
55
69
this . $platformService . removePlatforms ( platforms ) . wait ( ) ;
56
70
this . $pluginsService . remove ( "tns-core-modules" ) . wait ( ) ;
@@ -60,6 +74,7 @@ export class UpdateCommand implements ICommand {
60
74
shelljs . rm ( "-fr" , folder ) ;
61
75
}
62
76
77
+ platforms = platforms . concat ( packagePlatforms ) ;
63
78
if ( args . length === 1 ) {
64
79
for ( let platform of platforms ) {
65
80
this . $platformService . addPlatforms ( [ platform + "@" + args [ 0 ] ] ) . wait ( ) ;
0 commit comments