Skip to content

Commit e36ccc4

Browse files
committed
Fix script
1 parent 49b61f9 commit e36ccc4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

create_import_list.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,14 @@ const createImportStatement = async name => {
2929
return named
3030
}
3131

32-
const modelFiles = await fs.promises.readdir('./lib/model')
32+
const modelFiles = await fs.promises.readdir('./lib/model', { withFileTypes: true })
3333
const modelNames = []
3434

3535
for (const modelName of modelFiles) {
36-
const named = await createImportStatement(`model/${modelName}`)
37-
modelNames.push(...named)
36+
if (modelName.isFile() && modelName.name.endsWith('.js')) {
37+
const named = await createImportStatement(`model/${modelName.name}`)
38+
modelNames.push(...named)
39+
}
3840
}
3941

4042
const rlFiles = await fs.promises.readdir('./lib/rl')

0 commit comments

Comments
 (0)