fix(ci): clean up native Pascal verifier processes

This commit is contained in:
morluto
2026-10-14 02:59:15 +08:00
parent 4a9883b42c
commit ca7e980d49
3 changed files with 173 additions and 42 deletions
@@ -0,0 +1,17 @@
import { mkdtemp, realpath, rm } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
/** Allocate under a caller-selected parent and return the host's canonical spelling. */
export const createCanonicalTemporaryDirectory = async (
prefix,
parent = tmpdir(),
) => {
const allocatedPath = await mkdtemp(join(parent, prefix));
try {
return { path: await realpath(allocatedPath), allocatedPath };
} catch (cause) {
await rm(allocatedPath, { recursive: true, force: true });
throw cause;
}
};