szwacz/fs-jetpack

Calling jetpack.rename and passing path as second argument shouldn't do what it is currently doing

papb opened this issue · 0 comments

papb commented

By mistake, I did the following:

jetpack.rename('a/b/c.txt', 'a/b/d.txt');

To my surprise, I ended up with my tree structure as a/b/a/b/d.txt. So I went to the documentation for jetpack.readme (should have done that before, of course, but still):

newName new name for this thing (not full path, just a name).

So that explains that I used it incorrectly. But how about throwing an error instead of behaving like this?

Regardless, at least the documentation deserves an update.