copy icon indicating copy to clipboard operation
copy copied to clipboard

Recurcively creates directories copying single file

Open shrimpwagon opened this issue 8 years ago • 5 comments

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.

shrimpwagon avatar Jan 06 '17 15:01 shrimpwagon

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);
});

jonschlinkert avatar Jan 06 '17 18:01 jonschlinkert

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!

sandervm avatar Mar 24 '17 10:03 sandervm

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

Prophet32j avatar Apr 19 '17 02:04 Prophet32j

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...

jonschlinkert avatar Apr 19 '17 02:04 jonschlinkert

Helped me too.

PetersonLian avatar Jun 05 '17 08:06 PetersonLian