mirror of
https://github.com/morluto/rea.git
synced 2026-10-11 21:39:55 +00:00
Keep directory handles under explicit close ownership and retain ZIP and Mach-O admission owners when initialization or cleanup fails. Preserve cancellation and primary failure details, and avoid false successful release after native handle invalidation. Validation: filesystem ownership, FIFO, archive and reconstruction boundary checks; static and architecture checks; real macOS CLI/MCP bundle workflows. Windows native behavior was not verified.
16 lines
533 B
JavaScript
16 lines
533 B
JavaScript
import { pathToFileURL } from "node:url";
|
|
|
|
const [modulePath, root] = process.argv.slice(2);
|
|
if (modulePath === undefined || root === undefined)
|
|
throw new Error("Directory reader probe requires module and root paths");
|
|
|
|
const { DirectoryArtifactReader } = await import(pathToFileURL(modulePath));
|
|
const reader = new DirectoryArtifactReader(root);
|
|
const paths = [];
|
|
try {
|
|
for await (const entry of reader.entries()) paths.push(entry.path);
|
|
} finally {
|
|
await reader.close();
|
|
}
|
|
process.stdout.write(`${JSON.stringify(paths)}\n`);
|