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

.move method work like copy #9

Open
Akiyamka opened this issue Feb 17, 2020 · 0 comments
Open

.move method work like copy #9

Akiyamka opened this issue Feb 17, 2020 · 0 comments

Comments

@Akiyamka
Copy link
Contributor

Akiyamka commented Feb 17, 2020

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

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

1 participant