Skip to content

Commit 4e1ee68

Browse files
committed
Fix CI error: define DEFAULT_IGNORE_DIRS and isIgnoredDir in generate-manifest.js
Add missing DEFAULT_IGNORE_DIRS constant and isIgnoredDir function that were referenced but never defined, causing ReferenceError in CI. Also fix syntax error in test file (extra closing braces).
1 parent 9e293f0 commit 4e1ee68

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

scripts/generate-manifest.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,20 @@ async function listMetadataFiles(dir, results = []) {
6464
return results;
6565
}
6666

67+
const DEFAULT_IGNORE_DIRS = Object.freeze(['fitting', 'output_*', 'data', 'archive']);
68+
69+
function isIgnoredDir(dirName, ignoreDirs) {
70+
return ignoreDirs.some(pattern => {
71+
if (pattern === dirName) return true;
72+
if (pattern.includes('*')) {
73+
const escaped = pattern.replace(/[.+^${}()|[\]\\]/g, '\\$&');
74+
const regex = new RegExp('^' + escaped.replace(/\*/g, '.*') + '$');
75+
return regex.test(dirName);
76+
}
77+
return false;
78+
});
79+
}
80+
6781
function getIgnoreDirs(metadata) {
6882
const auxDirs = metadata?.source?.aux_dirs;
6983
if (auxDirs && Array.isArray(auxDirs)) {

scripts/generate-manifest.test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,4 @@ test('listModelFilesFiltered', async (t) => {
494494
{ code: 'ENOENT' }
495495
);
496496
});
497-
});
498-
});
499497
});

0 commit comments

Comments
 (0)