@@ -5,7 +5,7 @@ import * as temp from "temp";
5
5
import { EOL } from "os" ;
6
6
import { ITMSConstants } from "../constants" ;
7
7
import { ItunesConnectApplicationTypes } from "../constants" ;
8
- import { quoteString } from "../common/helpers" ;
8
+ import { quoteString , versionCompare } from "../common/helpers" ;
9
9
10
10
export class ITMSTransporterService implements IITMSTransporterService {
11
11
private _itmsTransporterPath : string = null ;
@@ -22,7 +22,6 @@ export class ITMSTransporterService implements IITMSTransporterService {
22
22
private $injector : IInjector ,
23
23
private $logger : ILogger ,
24
24
private $staticConfig : IStaticConfig ,
25
- private $sysInfo : ISysInfo ,
26
25
private $xcodeSelectService : IXcodeSelectService ) { }
27
26
28
27
// This property was introduced due to the fact that the $platformService dependency
@@ -166,17 +165,15 @@ export class ITMSTransporterService implements IITMSTransporterService {
166
165
return ( ( ) : string => {
167
166
if ( ! this . _itmsTransporterPath ) {
168
167
let xcodePath = this . $xcodeSelectService . getContentsDirectoryPath ( ) . wait ( ) ,
169
- sysInfo = this . $sysInfo . getSysInfo ( this . $staticConfig . pathToPackageJson ) . wait ( ) ,
170
- xcodeVersionMatch = sysInfo . xcodeVer . match ( / X c o d e ( .* ) / ) ,
168
+ xcodeVersion = this . $xcodeSelectService . getXcodeVersion ( ) . wait ( ) ,
171
169
result = path . join ( xcodePath , "Applications" , "Application Loader.app" , "Contents" ) ;
172
170
173
- if ( xcodeVersionMatch && xcodeVersionMatch [ 1 ] ) {
174
- let [ major , minor ] = xcodeVersionMatch [ 1 ] . split ( "." ) ;
175
- // iTMS Transporter's path has been modified in Xcode 6.3
176
- // https://github.com/nomad/shenzhen/issues/243
177
- if ( + major <= 6 && + minor < 3 ) {
171
+ xcodeVersion . patch = xcodeVersion . patch || "0" ;
172
+ // iTMS Transporter's path has been modified in Xcode 6.3
173
+ // https://github.com/nomad/shenzhen/issues/243
174
+ if ( xcodeVersion . major && xcodeVersion . minor &&
175
+ versionCompare ( xcodeVersion , "6.3.0" ) < 0 ) {
178
176
result = path . join ( result , "MacOS" ) ;
179
- }
180
177
}
181
178
182
179
this . _itmsTransporterPath = path . join ( result , ITMSConstants . iTMSDirectoryName , "bin" , ITMSConstants . iTMSExecutableName ) ;
0 commit comments