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

build: add files from electronjs.org-new #1982

Merged
merged 2 commits into from
Jul 14, 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
21 changes: 21 additions & 0 deletions script/collect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,15 @@ async function main() {
const tutorials = await filterTutorials(latestBranchContents)
const websiteContent = await fetchWebsiteContent()
const blogposts = await fetchWebsiteBlogPosts()
const newSite = await fetchNewWebsiteConfig()

const content = [
...apiDocs,
apiDefinitions,
...tutorials,
websiteContent,
...blogposts,
...newSite,
]

/**
Expand Down Expand Up @@ -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,
Expand Down