lukeed / taskr

A fast, concurrency-focused task automation tool.
MIT License
2.53k stars 74 forks source link

Flatten files at destination #262

Closed dredzone closed 7 years ago

dredzone commented 7 years ago

How to flatten directories when when copy files? target(dir, {depth: *}), depth option has no effect in version 2^.

lukeed commented 7 years ago

That is correct. The depth option from fly.target was removed in v2.

It now exists as a separate package (fly-flatten) for those who need it.

Thanks for the issue. You reminded me that I needed to release this plugin. 😄

dredzone commented 7 years ago

thanks for looking, but issue is still there, and I think it's related to task.target and glob replacement,

below is example

yield fly
  .source("jspm_packages/npm/font-awesome*/fonts/*.{woff2,woff,svg,eot,ttf,otf}")
  .flatten()
  .target("dist/fonts/font-awesome");

expected: /dist/fonts/font-awesome/ output (from above code): dist/fonts/font-awesome/font-awesome@4.7.0/fonts/

lukeed commented 7 years ago

No problem!

Yes, that's actually expected. fly-target begins reading from the first instance of *. So you'll need to specify the full font-awesome string.

yield fly
  .source("jspm_packages/npm/font-awesome@4.7.0/fonts/*.{woff2,woff,svg,eot,ttf,otf}")
  .flatten()
  .target("dist/fonts/font-awesome");