@@ -9,7 +9,7 @@ import * as rimraf from 'rimraf';
9
9
import { AndroidSDK , Appium , Binary , ChromeDriver , GeckoDriver , IEDriver , Standalone } from '../binaries' ;
10
10
import { Logger , Options , Program } from '../cli' ;
11
11
import { Config } from '../config' ;
12
- import { Downloader , FileManager } from '../files' ;
12
+ import { FileManager } from '../files' ;
13
13
import { HttpUtils } from '../http_utils' ;
14
14
import { spawn } from '../utils' ;
15
15
@@ -117,24 +117,14 @@ function update(options: Options): Promise<void> {
117
117
HttpUtils . assignOptions ( { ignoreSSL, proxy} ) ;
118
118
let verbose = options [ Opt . VERBOSE ] . getBoolean ( ) ;
119
119
120
- // setup versions for binaries
121
120
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 ( ) ;
132
121
133
122
// if the file has not been completely downloaded, download it
134
123
// else if the file has already been downloaded, unzip the file, rename it, and give it
135
124
// permissions
136
125
if ( standalone ) {
137
126
let binary : Standalone = binaries [ Standalone . id ] ;
127
+ binary . versionCustom = options [ Opt . VERSIONS_STANDALONE ] . getString ( ) ;
138
128
promises . push ( FileManager . downloadFile ( binary , outputDir )
139
129
. then < void > ( ( downloaded : boolean ) => {
140
130
if ( ! downloaded ) {
@@ -150,18 +140,25 @@ function update(options: Options): Promise<void> {
150
140
}
151
141
if ( chrome ) {
152
142
let binary : ChromeDriver = binaries [ ChromeDriver . id ] ;
143
+ binary . versionCustom = options [ Opt . VERSIONS_CHROME ] . getString ( ) ;
153
144
promises . push ( updateBinary ( binary , outputDir , proxy , ignoreSSL ) . then ( ( ) => {
154
145
return Promise . resolve ( updateBrowserFile ( binary , outputDir ) ) ;
155
146
} ) ) ;
156
147
}
157
148
if ( gecko ) {
158
149
let binary : GeckoDriver = binaries [ GeckoDriver . id ] ;
150
+ if ( options [ Opt . VERSIONS_GECKO ] ) {
151
+ binary . versionCustom = options [ Opt . VERSIONS_GECKO ] . getString ( ) ;
152
+ }
159
153
promises . push ( updateBinary ( binary , outputDir , proxy , ignoreSSL ) . then ( ( ) => {
160
154
return Promise . resolve ( updateBrowserFile ( binary , outputDir ) ) ;
161
155
} ) ) ;
162
156
}
163
157
if ( ie64 ) {
164
158
let binary : IEDriver = binaries [ IEDriver . id ] ;
159
+ if ( options [ Opt . VERSIONS_IE ] ) {
160
+ binary . versionCustom = options [ Opt . VERSIONS_IE ] . getString ( ) ;
161
+ }
165
162
binary . osarch = Config . osArch ( ) ; // Win32 or x64
166
163
promises . push ( updateBinary ( binary , outputDir , proxy , ignoreSSL ) . then ( ( ) => {
167
164
return Promise . resolve ( updateBrowserFile ( binary , outputDir ) ) ;
@@ -176,6 +173,7 @@ function update(options: Options): Promise<void> {
176
173
}
177
174
if ( android ) {
178
175
let binary = binaries [ AndroidSDK . id ] ;
176
+ binary . versionCustom = options [ Opt . VERSIONS_ANDROID ] . getString ( ) ;
179
177
let sdk_path = path . resolve ( outputDir , binary . executableFilename ( ) ) ;
180
178
let oldAVDList : string ;
181
179
@@ -195,16 +193,18 @@ function update(options: Options): Promise<void> {
195
193
initializeAndroid (
196
194
path . resolve ( outputDir , binary . executableFilename ( ) ) ,
197
195
android_api_levels , android_architectures , android_platforms ,
198
- android_accept_licenses , binaries [ AndroidSDK . id ] . versionCustom ,
196
+ android_accept_licenses , binary . versionCustom ,
199
197
JSON . parse ( oldAVDList ) , logger , verbose ) ;
200
198
} ) ) ;
201
199
}
202
200
if ( ios ) {
203
201
checkIOS ( logger ) ;
204
202
}
205
203
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 ) ;
208
208
}
209
209
210
210
return Promise . all ( promises ) . then ( ( ) => {
0 commit comments