MCPcopy
hub / github.com/EveryInc/compound-engineering-plugin / writeTextSecure

Function writeTextSecure

src/utils/files.ts:44–48  ·  view source on GitHub ↗
(filePath: string, content: string)

Source from the content-addressed store, hash-verified

42}
43
44export async function writeTextSecure(filePath: string, content: string): Promise<void> {
45 await ensureDir(path.dirname(filePath))
46 await fs.writeFile(filePath, content, { encoding: "utf8", mode: 0o600 })
47 await fs.chmod(filePath, 0o600)
48}
49
50export async function writeJson(filePath: string, data: unknown): Promise<void> {
51 const content = JSON.stringify(data, null, 2)

Callers 1

writeCodexBundleFunction · 0.90

Calls 1

ensureDirFunction · 0.85

Tested by

no test coverage detected