(relativePath: string, contents: string, force: boolean)
| 255 | } |
| 256 | |
| 257 | function 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 | |
| 269 | function prependDocsUpdate(options: WeeklyOptions, docsUpdate: string) { |
| 270 | const weeklyUpdatesPath = join(ROOT, "docs", "weekly-updates.mdx"); |
no test coverage detected