-
Notifications
You must be signed in to change notification settings - Fork 773
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
Error: EEXIST, file already exists '../mkdirp/bin/cmd.js' on fs.copySync() #94
Comments
And here's a workaround for now: fs.ensureDirSync(path.dirname(dest));
if (fs.statSync(file).isFile())
fs.writeFileSync(dest, fs.readFileSync(file)); |
Yeah, it's because |
@jprichardson Hmmm, for me |
Hmm, even if I use
I get true for both. So how can I get this to throw an error, intervene, etc when a file already exists? Edit: It seems there aren't any tests either that test the behaviour for what happens when a file already exists using |
Still getting an error here with latest versions: The error is a little bit different though:
Here are the versions used: package.json: {
"name": "test",
"dependencies": {
"fs-extra": "^0.16.3",
"glob": "^4.4.0"
}
} |
By default, do you think the sensible approach is to throw an error if the destination exists? But a flag like |
Yep, I think that would be the most sensible approach - that would be a breaking change though right? |
@jprichardson What needs done here yet? |
I believe two things:
And now looking at my most previous commits tagged here... IDK. Weird. @falmp or @Globegitter do you know what's still missing? |
@jprichardson Both these issues have been fixed. See #296 Closing, please reopen if I missed something. |
When copying files with fs.copySync(), I'm getting this error:
Here's a little script to reproduce:
package.json:
test.js:
I'm using node v0.10.33 on Mac OS X 10.10.1.
The text was updated successfully, but these errors were encountered: