Skip to content

Commit ede6374

Browse files
capture old releases
1 parent 7f09121 commit ede6374

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

lib/fetch-yui-docs.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@ import { all, resolve } from 'rsvp'
88

99
let filterValidVersions = (specificDocsVersion, ignorePreviouslyIndexedDoc) => version => {
1010
let isCompatibleVersion =
11-
compareVersions(version, '3.4.1') !== -1 &&
12-
!version.includes('beta') &&
13-
!version.includes('canary') &&
14-
!version.includes('alpha')
11+
// compareVersions(version, '3.4.1') !== -1 &&
12+
!version.includes('beta') && !version.includes('canary') && !version.includes('alpha')
1513

1614
if (!isEmpty(trim(specificDocsVersion)) && !ignorePreviouslyIndexedDoc) {
1715
return isCompatibleVersion && version.includes(specificDocsVersion)
@@ -43,11 +41,14 @@ async function fetchYuiDocsFromNpm(projects, projectName, filterValidVersionsFor
4341
return await all(
4442
versionsToProcess.map(async v => {
4543
let url = getProjectFileUrl(v)
44+
let targetDir = `tmp/s3-docs/v${v}`
45+
let targetFile = `${targetDir}/${projectName}-docs.json`
4646

4747
try {
48+
if (fs.existsSync(targetFile)) {
49+
return targetFile
50+
}
4851
let data = await download(url)
49-
let targetDir = `tmp/s3-docs/v${v}`
50-
let targetFile = `${targetDir}/${projectName}-docs.json`
5152

5253
mkdirp.sync(targetDir)
5354
fs.writeFileSync(targetFile, data)

lib/s3-sync.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ export async function downloadExistingDocsToLocal() {
5858
from: `${apiDocsBucketUrl}/rev-index`,
5959
to: 'tmp/rev-index',
6060
}),
61+
executeS3Sync({
62+
from: `${apiDocsBucketUrl}/s3-docs`,
63+
to: 'tmp/s3-docs',
64+
}),
6165
]
6266

6367
/* if (process.env.AWS_SHOULD_PUBLISH === 'yes') {

0 commit comments

Comments
 (0)