Skip to content

Commit

Permalink
build: don't throw in generate-docs when no readme
Browse files Browse the repository at this point in the history
  • Loading branch information
apaleslimghost committed Jul 25, 2024
1 parent a6542ab commit f1e0fb3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions scripts/generate-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ async function main() {
const readmePath = path.join('plugins', plugin, 'readme.md')
const generatedOptionsMarkdown = await formatPluginSchemas(plugin)

const originalReadme = await fs.readFile(readmePath, 'utf-8')

try {
const originalReadme = await fs.readFile(readmePath, 'utf-8')

const replacedReadme = replaceBetween(
originalReadme,
generatedOptionsMarkdown,
Expand All @@ -127,7 +127,11 @@ async function main() {
await fs.writeFile(readmePath, replacedReadme, 'utf-8')
console.log(`written ${readmePath}`)
} catch (e) {
console.error(`no replacement markers in ${readmePath}`)
if (e.code === 'ENOENT') {
console.error(`${plugin} has no readme`)
} else {
console.error(`no replacement markers in ${readmePath}`)
}
}
})
)
Expand Down

0 comments on commit f1e0fb3

Please sign in to comment.