Skip to content

[enhancement]: Make CopyFiles usable to copy single files out of source folders with a lot of subfolders/subpaths #20281

Open
@alexvy86

Description

Task name

CopyFiles@2

Describe your feature request here

We have a TypeScript monorepo that gets built in our pipelines, and if I try to use the CopyFile task to copy a single file from the root of the repo to another place, the task inevitable fails with an out-of-memory exception because it seems that this line enumerates every single subpath, including everything inside .git, everything inside node_modules, etc. All of that, when I provided a hardcoded filename for the single file that I wanted to copy.

Maybe a worthwhile optimization would be that if none of the specifiers in Contents have wildcards, instead of trying to enumerate everything in the repo and then match from there, directly copy the specified files? Or in general, only do tl.find() from the known paths from contents (up to the point where wildcards first show up).

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions