alunny / node-xcode

tools and utilities for working with xcode/ios projects
Apache License 2.0
226 stars 105 forks source link

Can't remove resources references from a group #70

Open akofman opened 9 years ago

akofman commented 9 years ago

I'm trying to remove some splash from the pbxproj :

myProj.parse(function (err) {
  if(err){
    console.log('Error: ' + JSON.stringify(err));
  }
  else{
    // Remove Portrait splascreens
    myProj.removeResourceFile('Default-Portrait~ipad.png');
    myProj.removeResourceFile('Default-Portrait@2x~ipad.png');

    fs.writeFileSync(projectPath, myProj.writeSync());
  }
});

Most of the splash references are well removed except in the group :

    308D05311370CCF300D202BF /* splash */ = {
            isa = PBXGroup;
            children = (
                30B4F2FD19D5E07200D9F7D8 /* Default-667h.png */,
                30B4F2FE19D5E07200D9F7D8 /* Default-736h.png */,
                30B4F2FF19D5E07200D9F7D8 /* Default-Landscape-736h.png */,
                D4A0D8751607E02300AEF8BB /* Default-568h@2x~iphone.png */,
                3088BBB7154F3926009F9C59 /* Default-Landscape@2x~ipad.png */,
                3088BBB8154F3926009F9C59 /* Default-Landscape~ipad.png */,
                3088BBB9154F3926009F9C59 /* Default-Portrait@2x~ipad.png */,
                3088BBBA154F3926009F9C59 /* Default-Portrait~ipad.png */,
                3088BBBB154F3926009F9C59 /* Default@2x~iphone.png */,
                3088BBBC154F3926009F9C59 /* Default~iphone.png */,
            );
            path = splash;
            sourceTree = "<group>";
        };

Is there a way to remove resources from this group ?

mcgrews3 commented 8 years ago

This pull request would address this: https://github.com/alunny/node-xcode/pull/82; See here for an example of the removeResourceFile I am proposing. Thanks.