mirror of
https://github.com/hanzoai/firebase-js-sdk.git
synced 2026-09-24 16:59:10 +00:00
Fix bug causing extra Node doc files to not be deleted (#1637)
Fix bug causing extra Node doc files to not be deleted
This commit is contained in:
committed by
GitHub
parent
69e7630e3a
commit
7b56d10b30
@@ -182,8 +182,10 @@ function checkForUnlistedFiles(filenamesFromToc, shouldRemove) {
|
||||
filename !== 'globals'
|
||||
) {
|
||||
if (shouldRemove) {
|
||||
console.log(`REMOVING ${filename} - not listed in toc.yaml.`);
|
||||
removePromises.push(() => fs.unlink(`${docPath}/${filename}`));
|
||||
console.log(
|
||||
`REMOVING ${docPath}/${filename}.html - not listed in toc.yaml.`
|
||||
);
|
||||
removePromises.push(fs.unlink(`${docPath}/${filename}.html`));
|
||||
} else {
|
||||
// This is just a warning, it doesn't need to finish before
|
||||
// the process continues.
|
||||
@@ -195,7 +197,9 @@ function checkForUnlistedFiles(filenamesFromToc, shouldRemove) {
|
||||
}
|
||||
});
|
||||
if (shouldRemove) {
|
||||
return Promise.all(removePromises).then(() => htmlFiles);
|
||||
return Promise.all(removePromises).then(() =>
|
||||
htmlFiles.filter(filename => filenamesFromToc.includes(filename))
|
||||
);
|
||||
} else {
|
||||
return htmlFiles;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user