Skip to content

Commit

Permalink
fix: explicitly sets the 'w' flag on writeFileSync to work around a n…
Browse files Browse the repository at this point in the history
…odejs 21.3.0 bug

see nodejs/node#50989
  • Loading branch information
sverweij committed Dec 4, 2023
1 parent 0d54c5f commit a532e90
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dist/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export function main(pOptions: IOptions, pErrorStream: Writable) {
if (!pOptions.dryRun) {
writeFileSync(pOptions.codeOwners, lCodeOwnersContent, {
encoding: "utf-8",
// need to explicitly set the "w" flag due to a bug in node 21.3.0 see https://github.com/nodejs/node/issues/50989
flag: "w",
});
}

Expand All @@ -33,6 +35,8 @@ export function main(pOptions: IOptions, pErrorStream: Writable) {
if (!pOptions.dryRun) {
writeFileSync(pOptions.labelerLocation, lLabelerContent, {
encoding: "utf-8",
// need to explicitly set the "w" flag due to a bug in node 21.3.0 see https://github.com/nodejs/node/issues/50989
flag: "w",
});
}
pErrorStream.write(
Expand Down

0 comments on commit a532e90

Please sign in to comment.