MCPcopy Create free account
hub / github.com/cifertech/DisplayKit / writeIfChanged

Function writeIfChanged

scripts/generate_icon_manifests.mjs:37–47  ·  view source on GitHub ↗
(filePath, content)

Source from the content-addressed store, hash-verified

35}
36
37async function writeIfChanged(filePath, content) {
38 let prev = null;
39 try {
40 prev = await fs.readFile(filePath, "utf8");
41 } catch {
42 // ignore
43 }
44 if (prev === content) return false;
45 await fs.writeFile(filePath, content, "utf8");
46 return true;
47}
48
49async function main() {
50 // Ensure icons dir exists

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected