Skip to content

Commit

Permalink
Merge pull request #27 from electron/3-0-x
Browse files Browse the repository at this point in the history
3.0.0-beta.1
  • Loading branch information
John Kleinschmidt committed Jun 21, 2018
2 parents 20ae18c + 1b0b79d commit 2ffa656
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 43 deletions.
38 changes: 36 additions & 2 deletions .circleci/config.yml
Expand Up @@ -4,10 +4,10 @@
#
version: 2
jobs:
build:
install-test-linux:
docker:
# specify the version you desire here
- image: circleci/node:7.10-browsers
- image: circleci/node:9-browsers

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
Expand Down Expand Up @@ -37,3 +37,37 @@ jobs:
- run: node --version
- run: npm --version
- run: npm test

install-test-osx:
macos:
xcode: "9.0"
steps:
- checkout

# Download and cache dependencies
- restore_cache:
keys:
- v1-mac-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-mac-dependencies-

- run: npm install

- save_cache:
paths:
- node_modules
key: v1-mac-dependencies-{{ checksum "package.json" }}

# run tests!
- run: node --version
- run: npm --version
- run: npm test

workflows:
version: 2
test-linux:
jobs:
- install-test-linux
test-osx:
jobs:
- install-test-osx
22 changes: 0 additions & 22 deletions Jenkinsfile

This file was deleted.

9 changes: 4 additions & 5 deletions README.md
@@ -1,7 +1,6 @@
# Electron ChromeDriver

[![Linux Build Status](https://circleci.com/gh/electron/chromedriver/tree/master.svg?style=shield)](https://circleci.com/gh/electron/chromedriver/tree/master)
[![Mac Build Status](https://mac-ci.electronjs.org/buildStatus/icon?job=Electron%20org/chromedriver/master)](https://mac-ci.electronjs.org/blue/organizations/jenkins/Electron%20org%2Fchromedriver/activity?branch=master)
[![Linux and Mac Build Status](https://circleci.com/gh/electron/chromedriver/tree/master.svg?style=shield)](https://circleci.com/gh/electron/chromedriver/tree/master)
[![Windows Build status](https://ci.appveyor.com/api/projects/status/43safb37jdlaeviw/branch/master?svg=true)](https://ci.appveyor.com/project/electron-bot/chromedriver/branch/master)
<br>
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/)
Expand All @@ -14,9 +13,9 @@
Simple node module to download the [ChromeDriver](https://sites.google.com/a/chromium.org/chromedriver)
version for [Electron](http://electron.atom.io).

This minor version of this library tracks the minor version of the Electron
versions released. So if you are using Electron `1.0.x` you would want to use
an `electron-chromedriver` dependency of `~1.0.0` in your `package.json` file.
The major version of this library tracks the major version of the Electron
versions released. So if you are using Electron `2.0.x` you would want to use
an `electron-chromedriver` dependency of `~2.0.0` in your `package.json` file.

This library is used by [spectron](https://github.com/electron/spectron).

Expand Down
22 changes: 10 additions & 12 deletions download-chromedriver.js
Expand Up @@ -2,19 +2,8 @@ var fs = require('fs')
var path = require('path')
var electronDownload = require('electron-download')
var extractZip = require('extract-zip')

var versionToDownload = require('./package').version

download(versionToDownload, function (err, zipPath) {
if (err) {
var versionSegments = versionToDownload.split('.')
var baseVersion = versionSegments[0] + '.' + versionSegments[1] + '.0'
download(baseVersion, processDownload)
} else {
processDownload(err, zipPath)
}
})

function download (version, callback) {
electronDownload({
version: version,
Expand All @@ -30,11 +19,20 @@ function processDownload (err, zipPath) {
if (err != null) throw err
extractZip(zipPath, {dir: path.join(__dirname, 'bin')}, function (error) {
if (error != null) throw error
console.log('successfully downloaded and extracted!')
if (process.platform !== 'win32') {
fs.chmod(path.join(__dirname, 'bin', 'chromedriver'), '755', function (error) {
if (error != null) throw error
})
}
})
}

download(versionToDownload, function (err, zipPath) {
if (err) {
var versionSegments = versionToDownload.split('.')
var baseVersion = versionSegments[0] + '.' + versionSegments[1] + '.0'
download(baseVersion, processDownload)
} else {
processDownload(err, zipPath)
}
})
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "electron-chromedriver",
"version": "2.0.0",
"version": "3.0.0-beta.1",
"description": "Electron ChromeDriver",
"repository": "https://github.com/electron/chromedriver",
"bin": {
Expand Down
2 changes: 1 addition & 1 deletion test/chromedriver-test.js
Expand Up @@ -20,7 +20,7 @@ describe('chromedriver binary', function () {
chromeDriver.stderr.on('data', function (data) { output += data })

chromeDriver.on('close', function () {
assert.equal(output.indexOf('ChromeDriver 2.30'), 0, 'Unpexected version: ' + output)
assert.equal(output.indexOf('ChromeDriver 2.36'), 0, 'Unpexected version: ' + output)
})

chromeDriver.on('error', done)
Expand Down

0 comments on commit 2ffa656

Please sign in to comment.