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

fix: only download on chromium_revision #170

Merged
merged 2 commits into from
Jan 22, 2018
Merged
Changes from all commits
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
13 changes: 10 additions & 3 deletions sync/PuppeteerChromeSyncer.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,22 @@ proto.listdiff = function* listdiff(fullname, dirIndex) {
followRedirect: true,
});
const versions = result.data.versions || {};
const needs = [];
const chromium_revisions = {};
for (var version in versions) {
const pkg = versions[version];
const puppeteerInfo = pkg.puppeteer || {};
if (!puppeteerInfo.chromium_revision) continue;
if (chromium_revisions[puppeteerInfo.chromium_revision]) continue;

const publish_time = result.data.time[pkg.version];
chromium_revisions[puppeteerInfo.chromium_revision] = publish_time;
}

const needs = [];
for (var chromium_revision in chromium_revisions) {
const publish_time = chromium_revisions[chromium_revision];
for (const parentDir of parentDirs) {
const dirname = '/' + parentDir + '/' + puppeteerInfo.chromium_revision + '/';
const dirname = '/' + parentDir + '/' + chromium_revision + '/';

if (existDirsMap[dirname]) {
existsCount++;
Expand All @@ -93,7 +100,7 @@ proto.listdiff = function* listdiff(fullname, dirIndex) {

// dir
needs.push({
name: puppeteerInfo.chromium_revision + '/',
name: chromium_revision + '/',
parent: '/' + parentDir + '/',
date: publish_time,
size: '-',
Expand Down