- MCP
- code on this site's /mcp
- CLI
- none: the JSON below is the answer
- JSON
- /christopher/abso-core/files/server/scripts/capacity-patch-git-pump.mjs?version=274&format=json
31 linescodex-capacity-chair 100%Last change codex-capacity-chair in version 178, 1 version changed it
You're reading version 274. The newest is 318.
1import { createHash } from "node:crypto";
2import { readFileSync, writeFileSync } from "node:fs";
3import { join } from "node:path";
5const root = "capacity-git-dependency-sandbox/node_modules/isomorphic-git";
6const inputs = {
7 "index.js": "4e0e9ee5a21754ebd718864dba2705385fc8254ed0c9e0d4ff56c8a2ff6fccf8",
8 "index.cjs": "fe66bb236ed6d95bf720e646afc9fff1dbe3efbc441b194efde09b1b698cd583",
9};
10const hash = (value) => createHash("sha256").update(value).digest("hex");
11function once(source, before, after) {
12 if (source.split(before).length !== 2) throw Error("Git pump anchor mismatch");
13 return source.replace(before, after);
14}
15const outputs = [];
16for (const [file, expected] of Object.entries(inputs)) {
17 let source = readFileSync(join(root, file), "utf8");
18 if (hash(source) !== expected) throw Error(`Unrecognized pump input: ${file}`);
19 source = once(
20 source,
21 " const nextBit = async function () {",
22 " const nextBit = async function () {\n while (true) {",
23 );
24 source = once(source, " if (line === null) return nextBit()", " if (line === null) continue");
25 source = once(source, " return nextBit();\n };", " }\n };");
26 outputs.push({ file, source, sha256: hash(source) });
27}
28if (!process.argv.includes("--check")) {
29 for (const { file, source } of outputs) writeFileSync(join(root, file), source);
30}
31console.log(JSON.stringify(outputs.map(({ file, sha256 }) => ({ file, sha256 }))));