MCPcopy Create free account
hub / github.com/cypress-io/cypress / processTextFile

Function processTextFile

packages/data-context/src/codegen/code-generator.ts:59–74  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

57 }
58
59 const processTextFile = async () => {
60 const fileContent = (await fs.readFile(file)).toString()
61 const { body, renderedAttributes } = frontMatter(fileContent, args)
62 const computedPath = computePath(
63 action.templateDir,
64 action.target,
65 path.join(
66 parsedFile.dir,
67 renderedAttributes.fileName || parsedFile.base,
68 ),
69 args,
70 )
71 const renderedTemplate = ejs.render(body, args)
72
73 return { computedPath, content: renderedTemplate, type: 'text' } as const
74 }
75
76 try {
77 const { content, computedPath, type } = isBinary

Callers 1

codeGeneratorFunction · 0.85

Calls 5

frontMatterFunction · 0.85
computePathFunction · 0.85
readFileMethod · 0.80
joinMethod · 0.80
renderMethod · 0.45

Tested by

no test coverage detected