Skip to content

Commit 3492066

Browse files
authored
Fix compat doc gen (#7629)
1 parent 0ae010e commit 3492066

File tree

1 file changed

+7
-22
lines changed

1 file changed

+7
-22
lines changed

scripts/docgen-compat/generate-docs.js

+7-22
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ const yargs = require('yargs');
2020
const fs = require('mz/fs');
2121
const path = require('path');
2222
const yaml = require('js-yaml');
23-
const typescript = require('typescript');
2423

2524
const repoPath = path.resolve(`${__dirname}/../..`);
2625

@@ -202,35 +201,21 @@ function checkForUnlistedFiles(filenamesFromToc) {
202201
const htmlFiles = files
203202
.filter(filename => filename.slice(-4) === 'html')
204203
.map(filename => filename.slice(0, -5));
205-
const removePromises = [];
206204
htmlFiles.forEach(filename => {
207205
if (
208206
!filenamesFromToc.includes(filename) &&
209207
filename !== 'index' &&
210208
filename !== 'globals'
211209
) {
212-
if (shouldRemove) {
213-
console.log(
214-
`REMOVING ${docPath}/${filename}.html - not listed in toc.yaml.`
215-
);
216-
removePromises.push(fs.unlink(`${docPath}/${filename}.html`));
217-
} else {
218-
// This is just a warning, it doesn't need to finish before
219-
// the process continues.
220-
console.warn(
221-
`Unlisted file: ${filename} generated ` +
222-
`but not listed in toc.yaml.`
223-
);
224-
}
210+
// This is just a warning, it doesn't need to finish before
211+
// the process continues.
212+
console.warn(
213+
`Unlisted file: ${filename} generated ` +
214+
`but not listed in toc.yaml.`
215+
);
225216
}
226217
});
227-
if (shouldRemove) {
228-
return Promise.all(removePromises).then(() =>
229-
htmlFiles.filter(filename => filenamesFromToc.includes(filename))
230-
);
231-
} else {
232-
return htmlFiles;
233-
}
218+
return htmlFiles;
234219
});
235220
}
236221

0 commit comments

Comments
 (0)