@@ -14,6 +14,8 @@ const info = helpers.getPackageInfo(pathToPackage);
1414
1515const pathToPlist = argv . pathToPlist || `${ pathToRoot } /ios/${ info . name } /Info.plist` ;
1616const pathToGradle = argv . pathToGradle || `${ pathToRoot } /android/app/build.gradle` ;
17+ // handle case of several plist files
18+ const pathsToPlists = Array . isArray ( pathToPlist ) ? pathToPlist : [ pathToPlist ] ;
1719
1820
1921// getting next version
@@ -25,7 +27,7 @@ let patch = helpers.version(versions[2], argv.patch, argv.major || argv.minor);
2527const version = `${ major } .${ minor } .${ patch } ` ;
2628
2729// getting next build number
28- const buildCurrent = helpers . getBuildNumberFromPlist ( pathToPlist ) ;
30+ const buildCurrent = helpers . getBuildNumberFromPlist ( pathsToPlists [ 0 ] ) ;
2931const build = buildCurrent + 1 ;
3032
3133// getting commit message
@@ -34,7 +36,7 @@ const message = messageTemplate.replace('${version}', version);
3436
3537log . info ( '\nI\'m going to increase the version in:' ) ;
3638log . info ( `- package.json (${ pathToPackage } );` , 1 ) ;
37- log . info ( `- ios project (${ pathToPlist } );` , 1 ) ;
39+ log . info ( `- ios project (${ pathsToPlists . join ( ', ' ) } );` , 1 ) ;
3840log . info ( `- android project (${ pathToGradle } ).` , 1 ) ;
3941
4042log . notice ( `\nThe version will be changed:` ) ;
@@ -70,7 +72,9 @@ const update = chain.then(() => {
7072} ) . then ( ( ) => {
7173 log . info ( 'Updating version in xcode project...' , 1 ) ;
7274
73- helpers . changeVersionAndBuildInPlist ( pathToPlist , version , build ) ;
75+ pathsToPlists . forEach ( pathToPlist => {
76+ helpers . changeVersionAndBuildInPlist ( pathToPlist , version , build ) ;
77+ } ) ;
7478 log . success ( `Version and build number in ios project (plist file) changed.` , 2 ) ;
7579} ) . then ( ( ) => {
7680 log . info ( 'Updating version in android project...' , 1 ) ;
@@ -91,7 +95,7 @@ const commit = update.then(() => {
9195 if ( answer === 'y' ) {
9296 return helpers . commitVersionIncrease ( version , message , [
9397 pathToPackage ,
94- pathToPlist ,
98+ ... pathsToPlists ,
9599 pathToGradle
96100 ] ) . then ( ( ) => {
97101 log . success ( `Commit with files added. Run "git push".` , 1 ) ;
0 commit comments