修复:生成绑定校验对不存在的目录不再静默通过

- snapshot() 遇到配置目录不存在时原来直接返回空表,空表比空表会被当成"通过(0 个文件)"
- 目录写错或已删除时改为打印"目录不存在,跳过校验",避免整组绑定被悄悄跳过
This commit is contained in:
2026-10-02 22:29:12 +08:00
parent 6f2eed0dc2
commit f593bd4bf6
+4 -1
View File
@@ -73,7 +73,10 @@ const targets = [
function snapshot(dir) {
const absolute = path.join(repoRoot, dir);
if (!fs.existsSync(absolute)) return new Map();
if (!fs.existsSync(absolute)) {
console.warn(`目录不存在,跳过校验:${dir}`);
return new Map();
}
return new Map(
fs
.readdirSync(absolute, { withFileTypes: true })