MCPcopy Index your code
hub / github.com/codeaashu/claude-code / safeWriteFile

Function safeWriteFile

src/skills/bundledSkills.ts:186–193  ·  view source on GitHub ↗
(p: string, content: string)

Source from the content-addressed store, hash-verified

184 O_NOFOLLOW
185
186async function safeWriteFile(p: string, content: string): Promise<void> {
187 const fh = await open(p, SAFE_WRITE_FLAGS, 0o600)
188 try {
189 await fh.writeFile(content, 'utf8')
190 } finally {
191 await fh.close()
192 }
193}
194
195/** Normalize and validate a skill-relative path; throws on traversal. */
196function resolveSkillFilePath(baseDir: string, relPath: string): string {

Callers 1

writeSkillFilesFunction · 0.85

Calls 2

openFunction · 0.85
closeMethod · 0.45

Tested by

no test coverage detected