mirror of
https://github.com/babalae/bettergi-scripts-list.git
synced 2026-03-20 04:10:00 +08:00
repo/js/采集cd管理: 增加了跳过文件夹的功能 (#1806)
* new feature: skip folders that end with .disabled * Updated readme and manifest. * Update some comments * Fix an issue where tasks unexpectedly stop
This commit is contained in:
@@ -15,5 +15,5 @@
|
||||
- **配队管理**:支持为每个路径组指定配队名称,自动切换配队。
|
||||
|
||||
## 使用方法
|
||||
1. 将要运行的地图追踪文件放在pathing文件夹下的不同路径组中,将会按照路径组的顺序执行,并跳过未刷新的路线
|
||||
1. 将要运行的地图追踪文件放在pathing文件夹下的不同路径组中,将会按照路径组的顺序执行,并跳过未刷新的路线。可以在文件夹名称后面添加“.disabled”以禁用这个文件夹下的路径追踪文件。
|
||||
2. 根据需要修改自定义配置,设置操作模式、路径组CD类型、配队名称等参数。
|
||||
@@ -159,8 +159,11 @@ async function readFolder(folderPath, onlyJson) {
|
||||
// 临时数组,用于存储子文件夹路径
|
||||
const subFolders = [];
|
||||
for (const filePath of filesInSubFolder) {
|
||||
if (file.IsFolder(filePath)) {
|
||||
// 如果是文件夹,先存储到临时数组中
|
||||
if (file.IsFolder(filePath)) { // 如果是文件夹,先存储到临时数组中
|
||||
if (filePath.toLowerCase().endsWith(".disabled")) { // 跳过以.disabled结尾的被禁用的路径
|
||||
log.info(`跳过禁用的文件夹:${filePath}`);
|
||||
continue;
|
||||
}
|
||||
subFolders.push(filePath);
|
||||
} else {
|
||||
// 如果是文件,根据 onlyJson 判断是否存储
|
||||
@@ -236,10 +239,10 @@ async function readFolder(folderPath, onlyJson) {
|
||||
const targetFolder = `pathing/路径组${i}`; // 动态生成目标文件夹路径
|
||||
const files = await readFolder(targetFolder, true);
|
||||
const filePaths = files.map(file => file.fullPath);
|
||||
// 如果文件夹为空,退出循环
|
||||
// 如果文件夹为空,跳过当前路径组
|
||||
if (filePaths.length === 0) {
|
||||
log.info(`路径组${i} 文件夹为空,停止处理`);
|
||||
break;
|
||||
log.info(`路径组${i} 文件夹为空,跳过`);
|
||||
continue;
|
||||
}
|
||||
// 用于存储符合条件的文件名的数组
|
||||
const jsonFileNames = [];
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
{
|
||||
"manifest_version": 1,
|
||||
"name": "采集cd管理",
|
||||
"version": "1.3.2",
|
||||
"version": "1.3.3",
|
||||
"bgi_version": "0.44.8",
|
||||
"description": "仅面对会操作文件和读readme的用户,基于文件夹操作自动管理采集路线的cd,会按照路径组的顺序依次运行,直到指定的时间,并会按照给定的cd类型,自动跳过未刷新的路线",
|
||||
"authors": [
|
||||
{
|
||||
"name": "mno",
|
||||
"links": "https://github.com/Bedrockx"
|
||||
},
|
||||
{
|
||||
"name": "Juhao73692",
|
||||
"links": "https://github.com/Juhao73692"
|
||||
}
|
||||
],
|
||||
"settings_ui": "settings.json",
|
||||
|
||||
Reference in New Issue
Block a user