fix: 保留ktWorkflow清理模板目录
This commit is contained in:
parent
1e39a431b7
commit
a2f98b7c00
@ -2082,8 +2082,8 @@ export async function runSelfTest(): Promise<void> {
|
||||
const workspaceHistoryRoot = cleanupRoots.find(
|
||||
(item) => item.root === ".kt-workspace",
|
||||
);
|
||||
if (testArtifactsRoot?.preservedNames.includes("_templates")) {
|
||||
throw new Error("cleanup template migration self-check failed");
|
||||
if (!testArtifactsRoot?.preservedNames.includes("_templates")) {
|
||||
throw new Error("cleanup template preservation self-check failed");
|
||||
}
|
||||
if (!workspaceHistoryRoot?.preservedNames.includes("test-artifacts")) {
|
||||
throw new Error("cleanup workspace root preservation self-check failed");
|
||||
|
||||
@ -52,8 +52,8 @@ const workspaceRootPreservedNames = new Set([
|
||||
|
||||
/**
|
||||
* Builds the directory names that represent generated artifact categories under
|
||||
* `.kt-workspace`; reusable templates and references are intentionally not
|
||||
* preserved here because they belong in `workspace-assets`.
|
||||
* `.kt-workspace`; test artifact templates stay in place because KT page and
|
||||
* business test flows use them as local scaffolding inputs.
|
||||
*
|
||||
* @param rootRelativePath - Cleanup root relative to the KT workspace.
|
||||
* @returns Category names that cleanup should skip when pruning `.kt-workspace`.
|
||||
@ -66,6 +66,9 @@ function buildPreservedNames(rootRelativePath: string): Set<string> {
|
||||
preservedNames.add(name);
|
||||
}
|
||||
}
|
||||
if (rootRelativePath === '.kt-workspace/test-artifacts') {
|
||||
preservedNames.add('_templates');
|
||||
}
|
||||
|
||||
return preservedNames;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user