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

ensureFile do not create file if there is a folder of the same name at given path #470

Closed
devrafalko opened this issue Jul 30, 2017 · 3 comments

Comments

@devrafalko
Copy link

devrafalko commented Jul 30, 2017

fs.ensureFile('./dist/new.js',(err)=>{
  console.log('file: ',err);
});

If there is ./dist/new.js folder at this path, the ensureFile method do not create new.js file and do not throw any error in callback function: err:undefined.
Vice versa, if there is ./dist/new.js file and I attempt to add folder of the same name and path with ensureDir, this method correctly throws error in the callback function: Error: EEXIST: file already exists.

@devrafalko devrafalko changed the title ensureFile the same path ensureFile do not create file if there is a folder of the same name at given path Jul 30, 2017
@RyanZim
Copy link
Collaborator

RyanZim commented Jul 31, 2017

This was fixed by #466, but it's not released yet. I'll try to release a new version ASAP.

@RyanZim
Copy link
Collaborator

RyanZim commented Jul 31, 2017

Released in fs-extra 4.0.1 🎉

@RyanZim RyanZim closed this as completed Jul 31, 2017
@devrafalko
Copy link
Author

great! thank you 👍

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

No branches or pull requests

2 participants