build: replace electron-download with @electron/get

This commit is contained in:
Mark Lee 2020-03-10 12:57:10 -07:00
Родитель 7d080dd81c
Коммит b5f619661b
5 изменённых файлов: 355 добавлений и 650 удалений

Просмотреть файл

@ -385,7 +385,7 @@ The project's configured to run automated tests on CircleCI.
If you wish to manually test the module, first comment out `opts.identity` in `test/basic.js` to enable auto discovery. Then run the command `npm test` from the dev directory.
When this command is run for the first time: `electron-download` will download macOS Electron releases defined in `test/config.json`, and save to `~/.electron/`, which might take up less than 1GB of disk space.
When this command is run for the first time: `@electron/get` will download macOS Electron releases defined in `test/config.json` and save to `~/Library/Caches/electron/`, which might take up less than 1GB of disk space.
A successful testing should look something like:
@ -398,7 +398,7 @@ $ npm test
> electron-osx-sign@0.4.15 test electron-osx-sign
> standard && tape test
Calling electron-download before running tests...
Downloading Electron prebuilt binaries before running tests...
Running tests...
TAP version 13
# setup

Просмотреть файл

@ -26,7 +26,7 @@
"plist": "^3.0.1"
},
"devDependencies": {
"electron-download": "^4.1.0",
"@electron/get": "^1.9.0",
"eslint": "^4.2.0",
"eslint-config-eslint": "^4.0.0",
"extract-zip": "^1.6.5",

Просмотреть файл

@ -9,7 +9,7 @@ series([
child.exec('which codesign', cb)
},
function (cb) {
console.log('Calling electron-download before running tests...')
console.log('Downloading Electron prebuilt binaries before running tests...')
util.downloadElectrons(cb)
}
], function (err) {

Просмотреть файл

@ -1,7 +1,7 @@
var path = require('path')
var test = require('tape')
var download = require('electron-download')
const { download } = require('@electron/get')
var mkdirp = require('mkdirp')
var rimraf = require('rimraf')
var series = require('run-series')
@ -45,10 +45,9 @@ exports.generateAppPath = function getExtractName (release) {
exports.downloadElectrons = function downloadElectrons (callback) {
series(releases.map(function (release) {
return function (cb) {
download(release, function (err, zipPath) {
if (err) return callback(err)
extract(zipPath, {dir: path.join(WORK_CWD, exports.generateReleaseName(release))}, cb)
})
download(release)
.then(zipPath => extract(zipPath, {dir: path.join(WORK_CWD, exports.generateReleaseName(release))}, cb))
.catch(cb)
}
}), callback)
}

988
yarn.lock

Разница между файлами не показана из-за своего большого размера Загрузить разницу