File tree 3 files changed +14
-0
lines changed
3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ interface IProjectDataService {
14
14
initialize ( projectDir : string ) : void ;
15
15
getValue ( propertyName : string ) : IFuture < any > ;
16
16
setValue ( key : string , value : any ) : IFuture < void > ;
17
+ removeProperty ( propertyName : string ) : IFuture < void > ;
17
18
}
18
19
19
20
interface IProjectTemplatesService {
Original file line number Diff line number Diff line change @@ -214,11 +214,16 @@ export class PlatformService implements IPlatformService {
214
214
215
215
public removePlatforms ( platforms : string [ ] ) : IFuture < void > {
216
216
return ( ( ) => {
217
+ this . $projectDataService . initialize ( this . $projectData . projectDir ) ;
218
+
217
219
_ . each ( platforms , platform => {
218
220
this . validatePlatformInstalled ( platform ) ;
221
+ let platformData = this . $platformsData . getPlatformData ( platform ) ;
219
222
220
223
var platformDir = path . join ( this . $projectData . platformsDir , platform ) ;
221
224
this . $fs . deleteDirectory ( platformDir ) . wait ( ) ;
225
+ this . $projectDataService . removeProperty ( platformData . frameworkPackageName ) . wait ( ) ;
226
+
222
227
this . $logger . out ( `Platform ${ platform } successfully removed.` ) ;
223
228
} ) ;
224
229
Original file line number Diff line number Diff line change @@ -38,6 +38,14 @@ export class ProjectDataService implements IProjectDataService {
38
38
this . $fs . writeJson ( this . projectFilePath , this . projectData , "\t" ) . wait ( ) ;
39
39
} ) . future < void > ( ) ( ) ;
40
40
}
41
+
42
+ public removeProperty ( propertyName : string ) : IFuture < void > {
43
+ return ( ( ) => {
44
+ this . loadProjectFile ( ) . wait ( ) ;
45
+ delete this . projectData [ this . $staticConfig . CLIENT_NAME_KEY_IN_PROJECT_FILE ] [ propertyName ] ;
46
+ this . $fs . writeJson ( this . projectFilePath , this . projectData , "\t" ) . wait ( ) ;
47
+ } ) . future < void > ( ) ( ) ;
48
+ }
41
49
42
50
private loadProjectFile ( ) : IFuture < void > {
43
51
return ( ( ) => {
You can’t perform that action at this time.
0 commit comments