@@ -20,7 +20,6 @@ const yargs = require('yargs');
20
20
const fs = require ( 'mz/fs' ) ;
21
21
const path = require ( 'path' ) ;
22
22
const yaml = require ( 'js-yaml' ) ;
23
- const typescript = require ( 'typescript' ) ;
24
23
25
24
const repoPath = path . resolve ( `${ __dirname } /../..` ) ;
26
25
@@ -202,35 +201,21 @@ function checkForUnlistedFiles(filenamesFromToc) {
202
201
const htmlFiles = files
203
202
. filter ( filename => filename . slice ( - 4 ) === 'html' )
204
203
. map ( filename => filename . slice ( 0 , - 5 ) ) ;
205
- const removePromises = [ ] ;
206
204
htmlFiles . forEach ( filename => {
207
205
if (
208
206
! filenamesFromToc . includes ( filename ) &&
209
207
filename !== 'index' &&
210
208
filename !== 'globals'
211
209
) {
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
+ ) ;
225
216
}
226
217
} ) ;
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 ;
234
219
} ) ;
235
220
}
236
221
0 commit comments