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

Recurcively creates directories copying single file #18

Open
shrimpwagon opened this issue Jan 6, 2017 · 5 comments
Open

Recurcively creates directories copying single file #18

shrimpwagon opened this issue Jan 6, 2017 · 5 comments

Comments

@shrimpwagon
Copy link

copy.one("public/assets/tmp/font-awesome-4.7.0/css/font-awesome.min.css", "public/assets/css");

This ends up creating the folders

public/assets/tmp/font-awesome-4.7.0/css

inside of:

public/assets/css

I just want to put the file into this directory without all the other dirs.

@jonschlinkert
Copy link
Owner

try passing an options object with {flatten: true} after the dest. Also, make sure you add a callback so you're notified of any errors:

(I usually try to commit first before doing new copy operations, might be a good idea here)

var src = "public/assets/tmp/font-awesome-4.7.0/css/font-awesome.min.css",
copy.one(src, "public/assets/css", {flatten: true}, function(err) {
  if (err) return console.log(err);
});

@sandervm
Copy link

Thanks! This is what I was looking for, maybe a suggestion to mention the possible settings of options in the documentation. I couldn't find them there!

@Prophet32j
Copy link

This is what I was looking for here, too. Updating to include what to pass as options would help. I was about to dig into the source to find if this was possible

@jonschlinkert
Copy link
Owner

Updating to include what to pass as options would help. I was about to dig into the source to find if this was possible

I'll make a note on the readme! thanks for the tip.

I'll keep this open as a reminder...

@PetersonLian
Copy link

Helped me too.

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

5 participants