copyfiles icon indicating copy to clipboard operation
copyfiles copied to clipboard

Copy from multiple sources to multiple sources using pattern

Open nermin99 opened this issue 2 years ago • 1 comments

I have these data.txt files I want to copy:

src
    d01
        index.ts
        data.txt
    d02
        index.ts
        data.txt

the destination is:

dist
    d01
        index.js
        index.js.map
    d02
        index.js
        index.js.map

So I was expecting that

copyfiles -u 2 src/d*/*.txt dist/d*
# or
# copyfiles -u 2 src/d*/data.txt dist/d*/data.txt

would yield

dist
    d01
        index.js
        index.js.map
        data.txt
    d02
        index.js
        index.js.map
        data.txt

but, at best, I only get that the second folder (d02) is populated and not both.

dist
    d01
        index.js
        index.js.map
    d02
        index.js
        index.js.map
        data.txt

Additionally, I get a "can't go up that far" error.

As you might've suspected this is for a TypeScript project.

nermin99 avatar Dec 05 '22 12:12 nermin99

I have a similar issue where the glob src/**/*.less does not copy all files, only files one layer deep. AFAIK ** should work for an arbitrary level of subfolders, e.g. src/a/b/file.less, but it only works for src/a/file.less. @nermin99 I ended up using cpy instead.

brunottonurb avatar Mar 07 '23 09:03 brunottonurb