mirror of
https://github.com/babalae/bettergi-scripts-list.git
synced 2026-03-25 04:59:52 +08:00
feat(FullyAutoAndSemiAutoTools): 添加黑名单白名单过滤功能
- 实现黑名单检查逻辑,过滤包含黑名单关键词的文件名 - 实现白名单检查逻辑,允许白名单中的项目通过过滤 - 添加JSON文件过滤功能,排除.json结尾的文件 - 修改子名称处理逻辑,支持数组形式的子名称存储 - 更新路径添加逻辑,集成过滤后的子名称数组
This commit is contained in:
@@ -273,18 +273,23 @@ async function init() {
|
||||
if (!currentName) {
|
||||
break; // 没有当前层级,停止处理
|
||||
}
|
||||
|
||||
const isBlacklisted = processedBlackList.some(item => childName?.includes(item));
|
||||
const isWhitelisted = processedWhiteList.some(item => childName?.includes(item));
|
||||
// 过滤JSON文件
|
||||
const filteredChildName = childName?.endsWith(".json") ? undefined : childName;
|
||||
|
||||
// 获取父级名称用于建立层级关系
|
||||
let child_names=[...filteredChildName]
|
||||
if (isBlacklisted && !isWhitelisted) {
|
||||
child_names=[]
|
||||
}
|
||||
|
||||
// 获取父级名称用于建立层级关系
|
||||
const parentName = getChildFolderNameFromRoot(pathRun, parentLevel);
|
||||
|
||||
await addUniquePath({
|
||||
level: parentLevel, // 存储到目标层级 属于目标层级
|
||||
name: currentName, // 当前层级名称
|
||||
parent_name: parentName, // 父级名称
|
||||
child_names: filteredChildName ? [filteredChildName] : []
|
||||
child_names: [...child_names]
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user