@@ -5,7 +5,7 @@ import * as temp from "temp";
55import { EOL } from "os" ;
66import { ITMSConstants } from "../constants" ;
77import { ItunesConnectApplicationTypes } from "../constants" ;
8- import { quoteString } from "../common/helpers" ;
8+ import { quoteString , versionCompare } from "../common/helpers" ;
99
1010export class ITMSTransporterService implements IITMSTransporterService {
1111 private _itmsTransporterPath : string = null ;
@@ -22,7 +22,6 @@ export class ITMSTransporterService implements IITMSTransporterService {
2222 private $injector : IInjector ,
2323 private $logger : ILogger ,
2424 private $staticConfig : IStaticConfig ,
25- private $sysInfo : ISysInfo ,
2625 private $xcodeSelectService : IXcodeSelectService ) { }
2726
2827 // This property was introduced due to the fact that the $platformService dependency
@@ -166,17 +165,15 @@ export class ITMSTransporterService implements IITMSTransporterService {
166165 return ( ( ) : string => {
167166 if ( ! this . _itmsTransporterPath ) {
168167 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 ( ) ,
171169 result = path . join ( xcodePath , "Applications" , "Application Loader.app" , "Contents" ) ;
172170
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 ) {
178176 result = path . join ( result , "MacOS" ) ;
179- }
180177 }
181178
182179 this . _itmsTransporterPath = path . join ( result , ITMSConstants . iTMSDirectoryName , "bin" , ITMSConstants . iTMSExecutableName ) ;
0 commit comments