-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Check if directories exist before removing during hoist #568
Conversation
src/commands/BootstrapCommand.js
Outdated
FileSystemUtilities.rimraf(path.join(dir, name), cb); | ||
const filePath = path.join(dir, name); | ||
if (!FileSystemUtilities.existsSync(filePath)) return cb(); | ||
FileSystemUtilities.rimraf(filePath, cb); |
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.
nit: as the same might happen in other places, would it be more reasonable to let FileSystemUtilities.rimraf
handle the case?
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.
Yeah, that might be cleaner. Will be an unnecessary stat
in most cases, but that's cheap.
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.
btw, i'd probably file a bug against rimraf
as it claims to be an equivalent to rm -rf
and it's not because -f
makes rm
to swallow the error while rimraf
fails.
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.
It's not that it fails, it's just slow compared to calling rimraf
in-process.
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.
got it, thx!
These noop rimrafs were cheap before lerna#547, but they're expensive now.
This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
These noop rimrafs were cheap before #547, but they're expensive now.