Api is misleading in some places.
Move it's copy
.move([ './some', './files' ], '../in/this/dir')
Files are expected to be moved to a ../in/this/dir directory, but instead they will be copied.
I suggest calling it "copy":
.copy([ './some', './files' ], '../in/this/dir');
Move method missed
Some time we need realy just move file to another dir.
Of course a method that really moves files mut be with name ".move".
In addition, this method can replace .rename method, just like a mv utility does in Unix systems:
Moving:
.move(['./someFile.js', './someAnotherFile.js'], './someFolder/')`;
Renaming:
.move(['./folder/someOldName.js'], './folder/someNewName.js');
Ambiguous api
Another problem is { from: ..., to: ... } syntax:
.move((answers) => [
{from: './' + answers.style, to: 'style/' + answers.style}
], '../../fake/destination')
There is no unambiguous interpretation of what a this command may mean.
This can mean - rename file from first name to second name, but we already have .rename function, hmm...
Or maybe this mean I can move the file from one to another directory!
Oh, but why then need a second argument in this case?
It frustrates me very much.
Semi-dynamics
I can use answers and arrays in first argument but can't in second - this is pretty weird.
I will write more about this in a separate issue
Api is misleading in some places.
Move it's copy
.move([ './some', './files' ], '../in/this/dir')Files are expected to be moved to a
../in/this/dirdirectory, but instead they will be copied.I suggest calling it "copy":
Move method missed
Some time we need realy just move file to another dir.
Of course a method that really moves files mut be with name ".move".
In addition, this method can replace
.renamemethod, just like amvutility does in Unix systems:Moving:
Renaming:
Ambiguous api
Another problem is
{ from: ..., to: ... }syntax:There is no unambiguous interpretation of what a this command may mean.
This can mean - rename file from first name to second name, but we already have
.renamefunction, hmm...Or maybe this mean I can move the file from one to another directory!
Oh, but why then need a second argument in this case?
It frustrates me very much.
Semi-dynamics
I can use answers and arrays in first argument but can't in second - this is pretty weird.
I will write more about this in a separate issue