Skip to content

Commit

Permalink
docs: fetchDocs script improvements
Browse files Browse the repository at this point in the history
* chore: improve error message in fetchDocs script

* chore: filter out falsy docs
  • Loading branch information
tylandavis authored May 10, 2024
1 parent b997291 commit fd94022
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/fetch-docs.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ const fetchDocs = async () => {
return doc
} catch (err) {
const msg = err instanceof Error ? err.message : err || 'Unknown error'
console.error(`Error fetching ${docFilename}: ${msg}`) // eslint-disable-line no-console
console.error(`Error fetching ${topicSlug}/${docFilename} in ${ref}: ${msg}`) // eslint-disable-line no-console
}
}),
)
Expand All @@ -147,7 +147,7 @@ const fetchDocs = async () => {
}),
)

const data = JSON.stringify(topics, null, 2)
const data = JSON.stringify(topics.filter(Boolean), null, 2)

const docsFilename = path.resolve(__dirname, outputDirectory)

Expand Down

0 comments on commit fd94022

Please sign in to comment.