Commit b361ec9 authored and committed Jan 28, 2020 Unverified
1 parent f61cbbd commit b361ec9 Copy full SHA for b361ec9
File tree 2 files changed +15
-2
lines changed
2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -229,6 +229,12 @@ Another option is to use env variable `CHROMEDRIVER_VERSION`.
229
229
CHROMEDRIVER_VERSION=LATEST npm install chromedriver
230
230
```
231
231
232
+ You can force the latest release for a specific major version by specifying ` LATEST_{VERSION_NUMBER} ` :
233
+
234
+ ``` shell
235
+ CHROMEDRIVER_VERSION=LATEST_80 npm install chromedriver
236
+ ```
237
+
232
238
You can also force a different version of chromedriver by replacing ` LATEST ` with a version number:
233
239
234
240
``` shell
Original file line number Diff line number Diff line change @@ -50,8 +50,15 @@ let chromedriverBinaryFilePath;
50
50
let downloadedFile = '' ;
51
51
52
52
Promise . resolve ( ) . then ( function ( ) {
53
- if ( chromedriver_version === 'LATEST' )
54
- return getLatestVersion ( getRequestOptions ( cdnUrl + '/LATEST_RELEASE' ) ) ;
53
+ if ( chromedriver_version === 'LATEST' ) {
54
+ return getLatestVersion ( getRequestOptions ( `${ cdnUrl } /LATEST_RELEASE` ) ) ;
55
+ } else {
56
+ const latestReleaseForVersionMatch = chromedriver_version . match ( / L A T E S T _ ( \d + ) / ) ;
57
+ if ( latestReleaseForVersionMatch ) {
58
+ const majorVersion = latestReleaseForVersionMatch [ 1 ] ;
59
+ return getLatestVersion ( getRequestOptions ( `${ cdnUrl } /LATEST_RELEASE_${ majorVersion } ` ) ) ;
60
+ }
61
+ }
55
62
} )
56
63
. then ( ( ) => {
57
64
tmpPath = findSuitableTempDirectory ( ) ;
You can’t perform that action at this time.
0 commit comments