@@ -13,8 +13,8 @@ export class UpdateCommand extends ValidatePlatformCommandBase implements IComma
13
13
private $projectDataService : IProjectDataService ,
14
14
private $fs : IFileSystem ,
15
15
private $logger : ILogger ) {
16
- super ( $options , $platformsData , $platformService , $projectData ) ;
17
- this . $projectData . initializeProjectData ( ) ;
16
+ super ( $options , $platformsData , $platformService , $projectData ) ;
17
+ this . $projectData . initializeProjectData ( ) ;
18
18
}
19
19
20
20
static readonly folders : string [ ] = [
@@ -83,8 +83,10 @@ export class UpdateCommand extends ValidatePlatformCommandBase implements IComma
83
83
}
84
84
85
85
await this . $platformService . removePlatforms ( platforms . installed , this . $projectData ) ;
86
- await this . $pluginsService . remove ( "tns-core-modules" , this . $projectData ) ;
87
- await this . $pluginsService . remove ( "tns-core-modules-widgets" , this . $projectData ) ;
86
+ await this . $pluginsService . remove ( constants . TNS_CORE_MODULES_NAME , this . $projectData ) ;
87
+ if ( ! ! this . $projectData . dependencies [ constants . TNS_CORE_MODULES_WIDGETS_NAME ] ) {
88
+ await this . $pluginsService . remove ( constants . TNS_CORE_MODULES_WIDGETS_NAME , this . $projectData ) ;
89
+ }
88
90
89
91
for ( const folder of UpdateCommand . folders ) {
90
92
this . $fs . deleteDirectory ( path . join ( this . $projectData . projectDir , folder ) ) ;
@@ -95,16 +97,16 @@ export class UpdateCommand extends ValidatePlatformCommandBase implements IComma
95
97
await this . $platformService . addPlatforms ( [ platform + "@" + args [ 0 ] ] , this . $options . platformTemplate , this . $projectData , this . $options , this . $options . frameworkPath ) ;
96
98
}
97
99
98
- await this . $pluginsService . add ( "tns-core-modules@" + args [ 0 ] , this . $projectData ) ;
100
+ await this . $pluginsService . add ( ` ${ constants . TNS_CORE_MODULES_NAME } @ ${ args [ 0 ] } ` , this . $projectData ) ;
99
101
} else {
100
102
await this . $platformService . addPlatforms ( platforms . packagePlatforms , this . $options . platformTemplate , this . $projectData , this . $options , this . $options . frameworkPath ) ;
101
- await this . $pluginsService . add ( "tns-core-modules" , this . $projectData ) ;
103
+ await this . $pluginsService . add ( constants . TNS_CORE_MODULES_NAME , this . $projectData ) ;
102
104
}
103
105
104
106
await this . $pluginsService . ensureAllDependenciesAreInstalled ( this . $projectData ) ;
105
107
}
106
108
107
- private getPlatforms ( ) : { installed : string [ ] , packagePlatforms : string [ ] } {
109
+ private getPlatforms ( ) : { installed : string [ ] , packagePlatforms : string [ ] } {
108
110
const installedPlatforms = this . $platformService . getInstalledPlatforms ( this . $projectData ) ;
109
111
const availablePlatforms = this . $platformService . getAvailablePlatforms ( this . $projectData ) ;
110
112
const packagePlatforms : string [ ] = [ ] ;
0 commit comments