This repository was archived by the owner on Feb 2, 2021. It is now read-only.
File tree 1 file changed +16
-1
lines changed
1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ export class SysInfoBase implements ISysInfo {
55
55
res . xcodeVer = this . $hostInfo . isDarwin ? this . exec ( "xcodebuild -version" ) : null ;
56
56
res . itunesInstalled = this . $iTunesValidator . getError ( ) . wait ( ) === null ;
57
57
58
- res . cocoapodVer = this . $hostInfo . isDarwin ? this . exec ( "pod --version" ) : null ;
58
+ res . cocoapodVer = this . getCocoapodVersion ( ) ;
59
59
let pathToAdb = androidToolsInfo ? androidToolsInfo . pathToAdb : "adb" ;
60
60
let pathToAndroid = androidToolsInfo ? androidToolsInfo . pathToAndroid : "android" ;
61
61
@@ -152,5 +152,20 @@ export class SysInfoBase implements ISysInfo {
152
152
return output ? / j a v a c ( .* ) / i. exec ( output . stderr ) [ 1 ] : null ;
153
153
} ) . future < string > ( ) ( ) ;
154
154
}
155
+
156
+ private getCocoapodVersion ( ) : string {
157
+ if ( this . $hostInfo . isDarwin ) {
158
+ let cocoapodVersion = this . exec ( "pod --version" ) ;
159
+ // Output of pod --version could contain some warnings. Find the version in it.
160
+ let cocoapodVersionMatch = cocoapodVersion . match ( / ^ ( (?: \d + \. ) { 2 } \d + .* ?) $ / gm) ;
161
+ if ( cocoapodVersionMatch && cocoapodVersionMatch [ 0 ] ) {
162
+ cocoapodVersion = cocoapodVersionMatch [ 0 ] . trim ( ) ;
163
+ }
164
+
165
+ return cocoapodVersion ;
166
+ }
167
+
168
+ return null ;
169
+ }
155
170
}
156
171
$injector . register ( "sysInfoBase" , SysInfoBase ) ;
You can’t perform that action at this time.
0 commit comments