-
Notifications
You must be signed in to change notification settings - Fork 596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: update to create packages folder when it doesn't already exist #1395
Conversation
*/ | ||
function createPackagesDir() { | ||
|
||
if (!fs.existsSync(destDir)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
…if said folder doesn't exist
Code Climate has analyzed commit 3be6988 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 88.3% (0.0% change). View more on Code Climate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jkmdev! This looks good, although I do think we should consider renaming the utility currently named createDirectory
* Utility function that creates new folders | ||
* based off dir argument | ||
*/ | ||
function createDirectory(dir) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is somewhat of a naming nit, but I think it may be helpful - perhaps we should consider renaming this function to something more along the lines of ensureDirectoryExists
. This is really a function that checks to ensure a directory exists and if it doesn't, it creates it. I think naming it to better align with that will help clarify it's purpose when reading through the copy and create functions above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! Yes that's a much clearer name, I'll make that change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jkmdev Looks like this was merged prior to you being able to push the change here - would you mind pushing a new PR to address the name change here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's named appropriately. The assurance is included in the conditional creation.
Description
Fixes #1392
Makes it so that the
copy-package-readme.js
script creates thedocs/en/packages
folder if it doesn't exist, instead of generating an error.Motivation & context
Without this change running
npm run docs:build
ornpm run docs:dry-run
would fail if thedocs/en/packages
folder didn't exist.Issue type checklist
Is this a breaking change?
Process & policy checklist