| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…ons.js When running `make doc` the CHANGELOG.md file is pulled everytime for each of the doc file that requires the versions list. This commit introduces a new file called `.master-CHANGELOG.md` which will be created once so that subsequent calls for the version are pulled locally instead of from the repo. Since this file is not part of the codebase proper, it is appended in the .gitignore file. References Issue nodejs#32512
| }); | ||
| }; | ||
|
|
||
| const createMaster = (masterPath, file) => { |
There was a problem hiding this comment.
this function only is used once, why not code inline?
Sorry, something went wrong.
There was a problem hiding this comment.
You are right. My bad.
Thanks for the suggestion.
Sorry, something went wrong.
…angelog Review for the pull request nodejs#32515 suggested to use inline command instead of creating a function that is not used again.
| const masterChangelog = path.join(srcRoot, '.master-CHANGELOG.md'); | ||
| if (kNoInternet) { | ||
| changelog = readFileSync(file, { encoding: 'utf8' }); | ||
| } else if (existsSync(masterChangelog)) { |
There was a problem hiding this comment.
This should probably be using statSync and check whether the file is outdated – otherwise this isn’t caching, it’s just storing a file and keeping it around forever.
(Also, it’s odd that we use fs.*Sync() functions inside an async function, although it’s not that important for this script. I’d suggest using readFile, stat, writeFile from fs.promises instead, just to reflect best practices.)
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
When running make doc the CHANGELOG.md file is pulled everytime for each
of the doc file that requires the versions list. This commit introduces a
new file called .master-CHANGELOG.md which will be created once so that
subsequent calls for the version are pulled locally instead of from the repo.
Since this file is not part of the codebase proper, it is appended in the
.gitignore file.
Closes #32512
Checklist