Versions 43 to 44
new file, 134 lines
14+
15+import { lstatSync, mkdirSync, readFileSync, renameSync, statSync, writeFileSync } from "node:fs";
19+
24+
33+
39+
47+
52+
53+ /** The folder's record, or an empty one when it's missing, unreadable, or from another format or client. */
62+ if (file.format === FORMAT && file.client === clientVersion() && typeof file.files === "object" && file.files)
69+
71+ * The key of a plain file on disk and its known copy; undefined for a link, or when either is missing.
72+ * Taken once per run: a key taken before a later read is still safe to mark with, since any change
92+
93+ /** Whether the file was the same as its known copy at this key, and if so whether it held a CR; undefined: read it. */
96+ if (entry === undefined || entry.id !== key.id || key.newest >= entry.at - RACY_MS) return undefined;
99+
115+
120+
121+ /** Write the record, if anything changed. Best effort: a run that can't write it just reads more next time. */
127+ const files = Object.fromEntries([...this.#entries].map(([rel, e]) => [rel, [e.id, e.at, e.cr]]));
- MCP
- compare on this site's /mcp
- CLI
- abso diff 43 44 client/src/clean-files.ts --json
- JSON
- /christopher/abso-core/compare/43..44?file=client%2Fsrc%2Fclean-files.ts&format=json