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

Copy file to directory does not work #10

Closed
protyposis opened this issue Dec 6, 2017 · 3 comments
Closed

Copy file to directory does not work #10

protyposis opened this issue Dec 6, 2017 · 3 comments
Assignees

Comments

@protyposis
Copy link

new FileManagerPlugin({
  onEnd: {
    copy: [
      {source: '/some/path/somefile.ext', destination: '/some/other/path'},
    ],
  },
});

Fails because it seems to try to copy a file onto a directory, as the verbose output suggests:

FileManagerPlugin: Start copy source file: /some/path/somefile.ext to destination file: /some/other/path

Expected:

FileManagerPlugin: Start copy source file: /some/path/somefile.ext to destination file: /some/other/path/somefile.ext

@gregnb
Copy link
Owner

gregnb commented Dec 6, 2017

Yeah, let me think more about this one. I mean, it could end up being a change like:

if source is a file and destination is a folder, then copy inside folder
if source is a folder and destination is a folder then overwrite it

but with this at least you can work around it by being explicit

new FileManagerPlugin({
  onEnd: {
    copy: [
      {source: '/some/path/somefile.ext', destination: '/some/other/path/somefile.ext'},
    ],
  },
});

@gregnb gregnb self-assigned this Dec 6, 2017
@protyposis
Copy link
Author

Thanks, yes a file should be copied inside a destination folder, and the contents of a source folder should be copied into a target folder while preserving all unrelated files that are already there.

I'm working around like you suggested but it adds unnecessary verbosity, and for the Glob approach it must be possible to specify a target folder anyway.

@gregnb
Copy link
Owner

gregnb commented Dec 27, 2017

This has been added to the latest version

@gregnb gregnb closed this as completed Jan 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants