Skip to content
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

Added the rmdir method #324

Merged
merged 4 commits into from
Sep 8, 2020
Merged

Added the rmdir method #324

merged 4 commits into from
Sep 8, 2020

Conversation

andreban
Copy link
Member

@andreban andreban commented Sep 8, 2020

This function is used to delete a file or directory hierarchy and
will be used to clean an existing project before regenerating it.

More context in #326

This function is used to delete a file or directory hierarchy and
will be used to clean an existing project before regenerating it.
packages/core/src/lib/util.ts Outdated Show resolved Hide resolved
Comment on lines +242 to +243
// This is a directory. We delete files and sub directories inside it, then delete the
// directory itself.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? What breaks if you just delete the directory?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Node 12 has a recursive option when deleting directories. Node 10 doesn't, and rmdir fails.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦

- stat fails on MacOs when the file doesn't exist.
@andreban andreban merged commit 66fa011 into GoogleChromeLabs:master Sep 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants