File tree Expand file tree Collapse file tree 4 files changed +18
-0
lines changed
Expand file tree Collapse file tree 4 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ interface IProjectDataService {
1414 initialize ( projectDir : string ) : void ;
1515 getValue ( propertyName : string ) : IFuture < any > ;
1616 setValue ( key : string , value : any ) : IFuture < void > ;
17+ removeProperty ( propertyName : string ) : IFuture < void > ;
1718}
1819
1920interface IProjectTemplatesService {
Original file line number Diff line number Diff line change @@ -214,11 +214,16 @@ export class PlatformService implements IPlatformService {
214214
215215 public removePlatforms ( platforms : string [ ] ) : IFuture < void > {
216216 return ( ( ) => {
217+ this . $projectDataService . initialize ( this . $projectData . projectDir ) ;
218+
217219 _ . each ( platforms , platform => {
218220 this . validatePlatformInstalled ( platform ) ;
221+ let platformData = this . $platformsData . getPlatformData ( platform ) ;
219222
220223 var platformDir = path . join ( this . $projectData . platformsDir , platform ) ;
221224 this . $fs . deleteDirectory ( platformDir ) . wait ( ) ;
225+ this . $projectDataService . removeProperty ( platformData . frameworkPackageName ) . wait ( ) ;
226+
222227 this . $logger . out ( `Platform ${ platform } successfully removed.` ) ;
223228 } ) ;
224229
Original file line number Diff line number Diff line change @@ -38,6 +38,14 @@ export class ProjectDataService implements IProjectDataService {
3838 this . $fs . writeJson ( this . projectFilePath , this . projectData , "\t" ) . wait ( ) ;
3939 } ) . future < void > ( ) ( ) ;
4040 }
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+ }
4149
4250 private loadProjectFile ( ) : IFuture < void > {
4351 return ( ( ) => {
Original file line number Diff line number Diff line change @@ -320,6 +320,10 @@ export class ProjectDataService implements IProjectDataService {
320320 setValue ( key : string , value : any ) : IFuture < void > {
321321 return Future . fromResult ( ) ;
322322 }
323+
324+ removeProperty ( propertyName : string ) : IFuture < void > {
325+ return Future . fromResult ( ) ;
326+ }
323327}
324328
325329export class ProjectHelperStub implements IProjectHelper {
You can’t perform that action at this time.
0 commit comments