You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you attempt to call copy('./some-file', './some-dir') you will get an error message that does not reflect what the docs are telling me not to do. The error message you get is about unlink, and I spent too much time tracking down what was really going on in a recent bit of code.
I now understand from issue #323 that it is intentional that a person should not try to call copy() with a file as the source and a directory as the destination, and I support the reasoning to have people be explicit in their intent. When I read the documentation for copy(), I see that this is explained clearly. But I wasn't the original author of the code and I wasn't the one reading the docs before writing the code. I was the debugger of code that came before me.
I propose that an error message be given that is consistent with the copy() documentation when the first arg is a file and the second arg is a directory. If that combination of arguments is documented to never be allowed, then the error message should reflect that.
The text was updated successfully, but these errors were encountered:
fs-extra
version: 8.1.0When you attempt to call
copy('./some-file', './some-dir')
you will get an error message that does not reflect what the docs are telling me not to do. The error message you get is aboutunlink
, and I spent too much time tracking down what was really going on in a recent bit of code.I now understand from issue #323 that it is intentional that a person should not try to call
copy()
with a file as the source and a directory as the destination, and I support the reasoning to have people be explicit in their intent. When I read the documentation forcopy()
, I see that this is explained clearly. But I wasn't the original author of the code and I wasn't the one reading the docs before writing the code. I was the debugger of code that came before me.I propose that an error message be given that is consistent with the
copy()
documentation when the first arg is a file and the second arg is a directory. If that combination of arguments is documented to never be allowed, then the error message should reflect that.The text was updated successfully, but these errors were encountered: