build(docs-infra): only render code example content in one place (#26514)

PR Close #26514
This commit is contained in:
George Kalpakas
2018-10-18 14:32:32 +03:00
committed by Miško Hevery
parent dd6e8424aa
commit f635c3ecec
3 changed files with 54 additions and 53 deletions

View File

@ -15,7 +15,7 @@ module.exports = function getExampleRegion(exampleMap, createDocMessage, collect
// If still no file then we error
if (!exampleFile) {
const gitIgnoreFile = collectExamples.isExampleIgnored(relativePath);
if( gitIgnoreFile) {
if (gitIgnoreFile) {
const message = createDocMessage('Ignored example file... relativePath: "' + relativePath + '"', doc) + '\n' +
'This example file exists but has been ignored by a rule, in "' + gitIgnoreFile + '".';
throw new Error(message);