From 828913d3f197afcb38cd5c23dcb3b17408955380 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3n=20Molleda?= Date: Tue, 13 Jul 2021 16:33:08 -0700 Subject: [PATCH] build: add files from electronjs.org-new There are some files in electronjs.org-new that are not part of the markdown that need to be translated as well. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Rel: https://github.com/electron/electronjs.org-new/issues/64 --- script/collect.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/script/collect.ts b/script/collect.ts index 9ae29cf55cc7b..aa10d5bb34809 100644 --- a/script/collect.ts +++ b/script/collect.ts @@ -88,6 +88,7 @@ async function main() { const tutorials = await filterTutorials(latestBranchContents) const websiteContent = await fetchWebsiteContent() const blogposts = await fetchWebsiteBlogPosts() + const newSite = await fetchNewWebsiteConfig() const content = [ ...apiDocs, @@ -95,6 +96,7 @@ async function main() { ...tutorials, websiteContent, ...blogposts, + ...newSite, ] /** @@ -230,6 +232,25 @@ async function fetchWebsiteBlogPosts() { }) } +async function fetchNewWebsiteConfig() { + console.log( + 'Fetching configuration files from electron/electronjs.org-new#main' + ) + + const files = await roggy('main', { + owner: 'electron', + repository: 'electronjs.org-new', + downloadMatch: 'i18n/en-US', + }) + + return files.map((file) => { + return { + ...file, + filename: path.join('website', 'i18n', file.filename), + } + }) +} + async function getObsoleteFiles(contents: Content[], destinationPath: string) { const currentFiles = walkSync(destinationPath, { directories: false,