MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / writeFile

Function writeFile

scripts/changelog-weekly.ts:257–267  ·  view source on GitHub ↗
(relativePath: string, contents: string, force: boolean)

Source from the content-addressed store, hash-verified

255}
256
257function writeFile(relativePath: string, contents: string, force: boolean) {
258 try {
259 writeFileSync(join(ROOT, relativePath), `${contents}\n`, { flag: force ? "w" : "wx" });
260 } catch (error) {
261 if ((error as NodeJS.ErrnoException).code === "EEXIST") {
262 fail(`${relativePath} already exists. Pass --force to overwrite it before review.`);
263 }
264 throw error;
265 }
266 console.log(`Wrote ${relativePath}`);
267}
268
269function prependDocsUpdate(options: WeeklyOptions, docsUpdate: string) {
270 const weeklyUpdatesPath = join(ROOT, "docs", "weekly-updates.mdx");

Callers 7

writeFilesWithRollbackFunction · 0.85
doWriteMethod · 0.85
_doAppendVersionMethod · 0.85
writeWeeklyPacketFunction · 0.85
animation-map.mjsFile · 0.85

Calls 1

failFunction · 0.70

Tested by

no test coverage detected