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

Prevent move into itself #458

Merged
merged 3 commits into from Jul 12, 2017
Merged

Prevent move into itself #458

merged 3 commits into from Jul 12, 2017

Conversation

manidlou
Copy link
Collaborator

Fixed the issue with move() when dest is a subdirectory of src. Also, removed shouldMkdirp option as we discussed before.

To quickly remind the issue, with existing behavior, running something like this

const src = 'src'
const dest = 'src/dest'
fs.move(src, dest, err => {
  if (err) return console.log(err)
  console.log('done.')
})

results in just removing src and essentially losing all src contents.

I believe we should prevent this from happening. Any feedback appreciated!

@coveralls
Copy link

Coverage Status

Coverage increased (+0.07%) to 86.992% when pulling d99d8a1 on prevent-move-into-itself into 85f531e on master.

Repository owner deleted a comment from coveralls Jul 10, 2017
Repository owner deleted a comment from coveralls Jul 10, 2017
@jprichardson jprichardson merged commit df6aa07 into master Jul 12, 2017
@jprichardson
Copy link
Owner

Stellar work @manidlou! @RyanZim please publish a patch when you're able.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants