@@ -763,28 +763,22 @@ function longComment(file, opt) {
763763
764764// respect <group> path
765765function correctForPluginsPath ( file , project ) {
766- var r_plugin_dir = / ^ P l u g i n s \/ / ;
767-
768- if ( project . pbxGroupByName ( 'Plugins' ) . path )
769- file . path = file . path . replace ( r_plugin_dir , '' ) ;
770-
771- return file ;
766+ return correctForPath ( file , project , 'Plugins' ) ;
772767}
773768
774769function correctForResourcesPath ( file , project ) {
775- var r_resources_dir = / ^ R e s o u r c e s \/ / ;
776-
777- if ( project . pbxGroupByName ( 'Resources' ) . path )
778- file . path = file . path . replace ( r_resources_dir , '' ) ;
779-
780- return file ;
770+ return correctForPath ( file , project , 'Resources' ) ;
781771}
782772
783773function correctForFrameworksPath ( file , project ) {
784- var r_resources_dir = / ^ F r a m e w o r k s \/ / ;
774+ return correctForPath ( file , project , 'Frameworks' ) ;
775+ }
776+
777+ function correctForPath ( file , project , group ) {
778+ var r_group_dir = new RegExp ( '^' + group + '[\\\\/]' ) ;
785779
786- if ( project . pbxGroupByName ( 'Frameworks' ) . path )
787- file . path = file . path . replace ( r_resources_dir , '' ) ;
780+ if ( project . pbxGroupByName ( group ) . path )
781+ file . path = file . path . replace ( r_group_dir , '' ) ;
788782
789783 return file ;
790784}
0 commit comments