mirror of
https://github.com/morluto/rea.git
synced 2026-11-11 17:28:08 +00:00
25 lines
649 B
JavaScript
25 lines
649 B
JavaScript
import { rm } from "node:fs/promises";
|
|
|
|
import { closeVerifierResources } from "./verifier-cleanup.mjs";
|
|
|
|
/** Remove copied authentication independently; retain ordinary files until commands release. */
|
|
export async function closeAgentEvaluation({
|
|
commands,
|
|
authPath,
|
|
evaluationRoot,
|
|
keepFixtures,
|
|
}) {
|
|
let commandsReleased = false;
|
|
await closeVerifierResources([
|
|
async () => {
|
|
await commands.close();
|
|
commandsReleased = true;
|
|
},
|
|
() => rm(authPath, { force: true }),
|
|
async () => {
|
|
if (commandsReleased && !keepFixtures)
|
|
await rm(evaluationRoot, { recursive: true, force: true });
|
|
},
|
|
]);
|
|
}
|