Skip to content
This repository has been archived by the owner on Mar 27, 2022. It is now read-only.

fix: atom-shell sync valid versions problem. (#241) #242

Merged
merged 2 commits into from
Oct 24, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: atom-shell sync valid versions problem. (#241)
atom-shell
  • Loading branch information
loverto committed Apr 19, 2020
commit 47cbc14c145a08e2708b2d29d25fe59ada07b5bc
13 changes: 8 additions & 5 deletions sync/atom-shell.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,17 @@ proto.listdir = function* (fullname) {
}

if (!this.versionsMap) {
// make sure version exists on https://registry.npmjs.com/electron
var pkgUrl = 'https://registry.npmjs.com/electron';
var pkgRes = yield urllib.request(pkgUrl, {
// make sure version exists on https://gh-contractor-zcbenz.s3.amazonaws.com/atom-shell/dist/index.json
var indexJSONUrl = 'https://gh-contractor-zcbenz.s3.amazonaws.com/atom-shell/dist/index.json';
var versions = yield urllib.request(indexJSONUrl, {
dataType: 'json',
timeout: 20000,
});
var pkg = pkgRes.data;
this.versionsMap = pkg.versions;
this.versionsMap = {};
for (var i = 0; i < versions.length; i++) {
var item = versions[i];
this.versionsMap[item.version] = item;
}
}

// skip not finished version, wait for all files upload success
Expand Down