@@ -9,7 +9,7 @@ import * as rimraf from 'rimraf';
99import { AndroidSDK , Appium , Binary , ChromeDriver , GeckoDriver , IEDriver , Standalone } from '../binaries' ;
1010import { Logger , Options , Program } from '../cli' ;
1111import { Config } from '../config' ;
12- import { Downloader , FileManager } from '../files' ;
12+ import { FileManager } from '../files' ;
1313import { HttpUtils } from '../http_utils' ;
1414import { spawn } from '../utils' ;
1515
@@ -117,24 +117,14 @@ function update(options: Options): Promise<void> {
117117 HttpUtils . assignOptions ( { ignoreSSL, proxy} ) ;
118118 let verbose = options [ Opt . VERBOSE ] . getBoolean ( ) ;
119119
120- // setup versions for binaries
121120 let binaries = FileManager . setupBinaries ( options [ Opt . ALTERNATE_CDN ] . getString ( ) ) ;
122- binaries [ Standalone . id ] . versionCustom = options [ Opt . VERSIONS_STANDALONE ] . getString ( ) ;
123- binaries [ ChromeDriver . id ] . versionCustom = options [ Opt . VERSIONS_CHROME ] . getString ( ) ;
124- if ( options [ Opt . VERSIONS_IE ] ) {
125- binaries [ IEDriver . id ] . versionCustom = options [ Opt . VERSIONS_IE ] . getString ( ) ;
126- }
127- if ( options [ Opt . VERSIONS_GECKO ] ) {
128- binaries [ GeckoDriver . id ] . versionCustom = options [ Opt . VERSIONS_GECKO ] . getString ( ) ;
129- }
130- binaries [ AndroidSDK . id ] . versionCustom = options [ Opt . VERSIONS_ANDROID ] . getString ( ) ;
131- binaries [ Appium . id ] . versionCustom = options [ Opt . VERSIONS_APPIUM ] . getString ( ) ;
132121
133122 // if the file has not been completely downloaded, download it
134123 // else if the file has already been downloaded, unzip the file, rename it, and give it
135124 // permissions
136125 if ( standalone ) {
137126 let binary : Standalone = binaries [ Standalone . id ] ;
127+ binary . versionCustom = options [ Opt . VERSIONS_STANDALONE ] . getString ( ) ;
138128 promises . push ( FileManager . downloadFile ( binary , outputDir )
139129 . then < void > ( ( downloaded : boolean ) => {
140130 if ( ! downloaded ) {
@@ -150,18 +140,25 @@ function update(options: Options): Promise<void> {
150140 }
151141 if ( chrome ) {
152142 let binary : ChromeDriver = binaries [ ChromeDriver . id ] ;
143+ binary . versionCustom = options [ Opt . VERSIONS_CHROME ] . getString ( ) ;
153144 promises . push ( updateBinary ( binary , outputDir , proxy , ignoreSSL ) . then ( ( ) => {
154145 return Promise . resolve ( updateBrowserFile ( binary , outputDir ) ) ;
155146 } ) ) ;
156147 }
157148 if ( gecko ) {
158149 let binary : GeckoDriver = binaries [ GeckoDriver . id ] ;
150+ if ( options [ Opt . VERSIONS_GECKO ] ) {
151+ binary . versionCustom = options [ Opt . VERSIONS_GECKO ] . getString ( ) ;
152+ }
159153 promises . push ( updateBinary ( binary , outputDir , proxy , ignoreSSL ) . then ( ( ) => {
160154 return Promise . resolve ( updateBrowserFile ( binary , outputDir ) ) ;
161155 } ) ) ;
162156 }
163157 if ( ie64 ) {
164158 let binary : IEDriver = binaries [ IEDriver . id ] ;
159+ if ( options [ Opt . VERSIONS_IE ] ) {
160+ binary . versionCustom = options [ Opt . VERSIONS_IE ] . getString ( ) ;
161+ }
165162 binary . osarch = Config . osArch ( ) ; // Win32 or x64
166163 promises . push ( updateBinary ( binary , outputDir , proxy , ignoreSSL ) . then ( ( ) => {
167164 return Promise . resolve ( updateBrowserFile ( binary , outputDir ) ) ;
@@ -176,6 +173,7 @@ function update(options: Options): Promise<void> {
176173 }
177174 if ( android ) {
178175 let binary = binaries [ AndroidSDK . id ] ;
176+ binary . versionCustom = options [ Opt . VERSIONS_ANDROID ] . getString ( ) ;
179177 let sdk_path = path . resolve ( outputDir , binary . executableFilename ( ) ) ;
180178 let oldAVDList : string ;
181179
@@ -195,16 +193,18 @@ function update(options: Options): Promise<void> {
195193 initializeAndroid (
196194 path . resolve ( outputDir , binary . executableFilename ( ) ) ,
197195 android_api_levels , android_architectures , android_platforms ,
198- android_accept_licenses , binaries [ AndroidSDK . id ] . versionCustom ,
196+ android_accept_licenses , binary . versionCustom ,
199197 JSON . parse ( oldAVDList ) , logger , verbose ) ;
200198 } ) ) ;
201199 }
202200 if ( ios ) {
203201 checkIOS ( logger ) ;
204202 }
205203 if ( android || ios ) {
206- installAppium ( binaries [ Appium . id ] , outputDir ) ;
207- updateBrowserFile ( binaries [ Appium . id ] , outputDir ) ;
204+ const binary = binaries [ Appium . id ] ;
205+ binary . versionCustom = options [ Opt . VERSIONS_APPIUM ] . getString ( ) ;
206+ installAppium ( binary , outputDir ) ;
207+ updateBrowserFile ( binary , outputDir ) ;
208208 }
209209
210210 return Promise . all ( promises ) . then ( ( ) => {
0 commit comments