@@ -1027,6 +1027,62 @@ exports.issueCommand = issueCommand;
10271027
10281028module . exports = require ( "child_process" ) ;
10291029
1030+ /***/ } ) ,
1031+
1032+ /***/ 335 :
1033+ /***/ ( function ( __unusedmodule , exports , __webpack_require__ ) {
1034+
1035+ "use strict" ;
1036+
1037+ var __createBinding = ( this && this . __createBinding ) || ( Object . create ? ( function ( o , m , k , k2 ) {
1038+ if ( k2 === undefined ) k2 = k ;
1039+ Object . defineProperty ( o , k2 , { enumerable : true , get : function ( ) { return m [ k ] ; } } ) ;
1040+ } ) : ( function ( o , m , k , k2 ) {
1041+ if ( k2 === undefined ) k2 = k ;
1042+ o [ k2 ] = m [ k ] ;
1043+ } ) ) ;
1044+ var __setModuleDefault = ( this && this . __setModuleDefault ) || ( Object . create ? ( function ( o , v ) {
1045+ Object . defineProperty ( o , "default" , { enumerable : true , value : v } ) ;
1046+ } ) : function ( o , v ) {
1047+ o [ "default" ] = v ;
1048+ } ) ;
1049+ var __importStar = ( this && this . __importStar ) || function ( mod ) {
1050+ if ( mod && mod . __esModule ) return mod ;
1051+ var result = { } ;
1052+ if ( mod != null ) for ( var k in mod ) if ( k !== "default" && Object . prototype . hasOwnProperty . call ( mod , k ) ) __createBinding ( result , mod , k ) ;
1053+ __setModuleDefault ( result , mod ) ;
1054+ return result ;
1055+ } ;
1056+ Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
1057+ exports . getVersionFromPodfile = exports . getVersionFromPodfileLine = void 0 ;
1058+ const fs = __importStar ( __webpack_require__ ( 747 ) ) ;
1059+ const path = __importStar ( __webpack_require__ ( 622 ) ) ;
1060+ const os_1 = __webpack_require__ ( 87 ) ;
1061+ const podVersionRegex = / ^ C O C O A P O D S : ( [ \d . ] + ( b e t a | r c ) ? \. ? \d * ) $ / i;
1062+ exports . getVersionFromPodfileLine = ( line ) => {
1063+ const match = line . match ( podVersionRegex ) ;
1064+ if ( match && match . length >= 2 ) {
1065+ return match [ 1 ] . trim ( ) ;
1066+ }
1067+ return null ;
1068+ } ;
1069+ exports . getVersionFromPodfile = ( podfilePath ) => {
1070+ const absolutePath = path . resolve ( podfilePath ) ;
1071+ if ( ! fs . existsSync ( absolutePath ) ) {
1072+ throw new Error ( `Podfile is not found on path '${ absolutePath } '` ) ;
1073+ }
1074+ const fileContent = fs . readFileSync ( absolutePath ) ;
1075+ const podLines = fileContent . toString ( ) . split ( os_1 . EOL ) ;
1076+ for ( const podLine of podLines ) {
1077+ const matchedVersion = exports . getVersionFromPodfileLine ( podLine ) ;
1078+ if ( matchedVersion ) {
1079+ return matchedVersion ;
1080+ }
1081+ }
1082+ throw new Error ( `Podfile '${ absolutePath } ' doesn't contain COCOAPODS version.` ) ;
1083+ } ;
1084+
1085+
10301086/***/ } ) ,
10311087
10321088/***/ 357 :
@@ -1623,9 +1679,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
16231679} ;
16241680Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
16251681exports . CocoapodsInstaller = void 0 ;
1626- const fs = __importStar ( __webpack_require__ ( 747 ) ) ;
1627- const path = __importStar ( __webpack_require__ ( 622 ) ) ;
1628- const os_1 = __webpack_require__ ( 87 ) ;
16291682const exec = __importStar ( __webpack_require__ ( 986 ) ) ;
16301683const core = __importStar ( __webpack_require__ ( 470 ) ) ;
16311684class CocoapodsInstaller {
@@ -1643,21 +1696,6 @@ class CocoapodsInstaller {
16431696 await exec . exec ( "gem" , [ "install" , "cocoapods" , ...versionArguments , "--no-document" ] ) ;
16441697 core . info ( `Cocoapods ${ versionSpec } has been installed successfully` ) ;
16451698 }
1646- static getVersionFromPodfile ( podfilePath ) {
1647- const absolutePath = path . resolve ( podfilePath ) ;
1648- if ( ! fs . existsSync ( absolutePath ) ) {
1649- throw new Error ( `Podfile is not found on path '${ absolutePath } '` ) ;
1650- }
1651- const fileContent = fs . readFileSync ( absolutePath ) ;
1652- const podLines = fileContent . toString ( ) . split ( os_1 . EOL ) ;
1653- for ( const podLine of podLines ) {
1654- const match = podLine . match ( this . podVersionRegex ) ;
1655- if ( match && match . length >= 2 ) {
1656- return match [ 1 ] . trim ( ) ;
1657- }
1658- }
1659- throw new Error ( `Podfile '${ absolutePath } ' doesn't contain COCOAPODS version.` ) ;
1660- }
16611699 static async getInstalledVersion ( ) {
16621700 let stdOutput = "" ;
16631701 const options = {
@@ -1675,7 +1713,6 @@ class CocoapodsInstaller {
16751713 }
16761714}
16771715exports . CocoapodsInstaller = CocoapodsInstaller ;
1678- CocoapodsInstaller . podVersionRegex = / ^ C O C O A P O D S : ( [ \d . ] + ) $ / i;
16791716
16801717
16811718/***/ } ) ,
@@ -1707,6 +1744,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
17071744Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
17081745const core = __importStar ( __webpack_require__ ( 470 ) ) ;
17091746const installer_1 = __webpack_require__ ( 749 ) ;
1747+ const podfile_parser_1 = __webpack_require__ ( 335 ) ;
17101748const run = async ( ) => {
17111749 try {
17121750 if ( process . platform !== "darwin" && process . platform !== "linux" ) {
@@ -1715,11 +1753,11 @@ const run = async () => {
17151753 let versionSpec = core . getInput ( "version" , { required : false } ) ;
17161754 const podfilePath = core . getInput ( "podfile-path" , { required : false } ) ;
17171755 if ( ! ! versionSpec === ! ! podfilePath ) {
1718- throw new Error ( "Invalid input parameters usage. Only 'version' or 'podfile-path' should be defined " ) ;
1756+ throw new Error ( "Invalid input parameters usage. Either 'version' or 'podfile-path' should be specified. Not the both ones. " ) ;
17191757 }
17201758 if ( ! versionSpec ) {
17211759 core . debug ( "Reading Podfile to determine the version of Cocoapods..." ) ;
1722- versionSpec = installer_1 . CocoapodsInstaller . getVersionFromPodfile ( podfilePath ) ;
1760+ versionSpec = podfile_parser_1 . getVersionFromPodfile ( podfilePath ) ;
17231761 core . info ( `Podfile points to the Cocoapods ${ versionSpec } ` ) ;
17241762 }
17251763 await installer_1 . CocoapodsInstaller . install ( versionSpec ) ;
0 commit comments