ensurePreconditions() had two branches: create-slice (which included tasks/) and slice-exists (which conditionally created tasks/). The conditional path could miss cases where a slice dir was created manually or by a previous run without the tasks/ subdirectory. Simplified to: create slice dir if missing, then always check and create tasks/ unconditionally. Removes the branching that could leave tasks/ missing.
This commit is contained in:
parent
8382e5bfcc
commit
1f9da9ed5f
1 changed files with 10 additions and 9 deletions
|
|
@ -3318,15 +3318,16 @@ function ensurePreconditions(
|
|||
const slicesDir = join(mDirResolved, "slices");
|
||||
const sDir = resolveDir(slicesDir, sid);
|
||||
if (!sDir) {
|
||||
// Create slice dir with bare ID
|
||||
const newSliceDir = join(slicesDir, sid);
|
||||
mkdirSync(join(newSliceDir, "tasks"), { recursive: true });
|
||||
} else {
|
||||
// Ensure tasks/ subdir exists
|
||||
const tasksDir = join(slicesDir, sDir, "tasks");
|
||||
if (!existsSync(tasksDir)) {
|
||||
mkdirSync(tasksDir, { recursive: true });
|
||||
}
|
||||
// Create slice dir with bare ID (tasks/ included)
|
||||
mkdirSync(join(slicesDir, sid, "tasks"), { recursive: true });
|
||||
}
|
||||
// Always ensure tasks/ subdir exists — even when slice dir was already
|
||||
// present. Handles the case where a slice was created manually or by a
|
||||
// previous run that didn't create tasks/. (#900)
|
||||
const resolvedSliceDir = resolveDir(slicesDir, sid) ?? sid;
|
||||
const tasksDir = join(slicesDir, resolvedSliceDir, "tasks");
|
||||
if (!existsSync(tasksDir)) {
|
||||
mkdirSync(tasksDir, { recursive: true });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue