diff --git a/scripts/generate-docs.js b/scripts/generate-docs.js index 356727a38..51be65c26 100644 --- a/scripts/generate-docs.js +++ b/scripts/generate-docs.js @@ -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, @@ -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}`) + } } }) )