Skip to content

Commit

Permalink
chore(www): Don't panic on missing showcase entry (#24741)
Browse files Browse the repository at this point in the history
  • Loading branch information
ascorbic committed Jun 3, 2020
1 parent 6f40048 commit 35d0dc6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions www/src/utils/node/starters.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ const fetchGithubData = async ({ owner, repo, reporter }, retry = 0) =>
})

exports.onCreateNode = ({ node, actions, getNode, reporter }) => {
const { createNodeField } = actions
const { createNodeField, deleteNode } = actions
if (node.internal.type === `StartersYaml` && node.repo) {
// To develop on the starter showcase, you'll need a GitHub
// personal access token. Check the `www` README for details.
Expand Down Expand Up @@ -183,7 +183,7 @@ exports.onCreateNode = ({ node, actions, getNode, reporter }) => {
const gatsbyMajorVersion = allDependencies
.filter(([key]) => key === `gatsby`)
.map(version => {
let [gatsby, versionNum] = version
const [gatsby, versionNum] = version
if (versionNum === `latest` || versionNum === `next`) {
return [gatsby, `2`]
}
Expand Down Expand Up @@ -219,10 +219,11 @@ exports.onCreateNode = ({ node, actions, getNode, reporter }) => {
})
})
.catch(err => {
reporter.panicOnBuild(
reporter.warn(
`Error getting repo data for starter "${repoStub}":\n
${err.message}`
)
deleteNode(node)
})
}
}
Expand Down

0 comments on commit 35d0dc6

Please sign in to comment.