fix: 任务列表忽略备份文件,避免同名重复任务
This commit is contained in:
parent
9d996f137b
commit
7c7a1b1a1f
@ -175,6 +175,7 @@ export function listFlows(): FlowSummary[] {
|
||||
const runs = latestRuns();
|
||||
for (const entry of fs.readdirSync(base)) {
|
||||
if (!entry.endsWith(".json")) continue;
|
||||
if (/-pre-|\\.bak/i.test(entry)) continue;
|
||||
try {
|
||||
const flow = JSON.parse(fs.readFileSync(path.join(base, entry), "utf8")) as FlowDefinition;
|
||||
if (!flow?.id || !Array.isArray(flow.nodes)) continue;
|
||||
@ -231,3 +232,4 @@ export function deleteFlow(id: string): void {
|
||||
const target = fileOf(id);
|
||||
if (fs.existsSync(target)) fs.unlinkSync(target);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user