fix(FN-4948): harden guard install failure cleanup paths
Fusion-Task-Id: FN-4948 Fusion-Task-Lineage: dc622643-4c3e-4217-9219-a6a6e5424427
This commit is contained in:
committed by
gsxdsm
parent
487dfcc10c
commit
4b16429618
@@ -1346,10 +1346,19 @@ Follow instructions precisely and avoid unrelated changes.`,
|
||||
throw err;
|
||||
}
|
||||
|
||||
await installTaskWorktreeIdentityGuard({
|
||||
worktreePath,
|
||||
taskId: this.options.taskDetail.id,
|
||||
});
|
||||
try {
|
||||
await installTaskWorktreeIdentityGuard({
|
||||
worktreePath,
|
||||
taskId: this.options.taskDetail.id,
|
||||
});
|
||||
} catch (err) {
|
||||
try {
|
||||
await execAsync(`rm -rf "${worktreePath}"`, { cwd: rootDir, env: this.options.taskEnv });
|
||||
} catch {
|
||||
stepExecLog.log(`Warning: failed to remove worktree after identity-guard install failure: ${worktreePath}`);
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
|
||||
this.registerParallelWorktree(stepIndex, worktreePath);
|
||||
this.parallelBranches.set(stepIndex, branchName);
|
||||
|
||||
Reference in New Issue
Block a user