MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / safeFileWrite

Function safeFileWrite

lib/command/utils.js:64–71  ·  view source on GitHub ↗
(file, contents)

Source from the content-addressed store, hash-verified

62export { updateConfig }
63
64function safeFileWrite(file, contents) {
65 if (fileExists(file)) {
66 output.error(`File ${file} already exist, skipping...`)
67 return false
68 }
69 fs.writeFileSync(file, contents)
70 return true
71}
72
73export { safeFileWrite }
74

Callers 6

testFunction · 0.90
pageObjectFunction · 0.90
helperFunction · 0.90
healFunction · 0.90
promptFunction · 0.90
init.jsFile · 0.90

Calls 1

fileExistsFunction · 0.90

Tested by 1

testFunction · 0.72