Copies the files matching a set of glob patterns into a target directory, keeping their relative layout.
Runs on the command line as ush cp <target> <pattern>....
Each match lands under target at its path relative to the base of its pattern, that is the leading segments free
of glob characters: src/**/*.css copies src/a/b.css to <target>/a/b.css, and a plain file path copies the
file to the top of target. Missing directories are created and existing files are overwritten.
Directories matched by a pattern are skipped: only files are copied.
Each copied file is printed on stdout as cp <source>, with the source path spelled as the pattern matched it.
Parameters
target: string
The directory receiving the copies
...patterns: readonlystring[]
The glob patterns selecting the files to copy
Returns void
Example
Shipping stylesheets next to the compiled modules, from an npm script:
ushcpdist'src/**/*.css'
Patterns are quoted so that they reach the tool unexpanded, as shells differ in their glob support.
Throws
TypeError If target is empty or if no pattern is provided
Throws
Error If a pattern matches no file, in which case no file is copied for any of the patterns
Copies the files matching a set of glob patterns into a target directory, keeping their relative layout.
Runs on the command line as
ush cp <target> <pattern>....Each match lands under
targetat its path relative to the base of its pattern, that is the leading segments free of glob characters:src/**/*.csscopiessrc/a/b.cssto<target>/a/b.css, and a plain file path copies the file to the top oftarget. Missing directories are created and existing files are overwritten.Directories matched by a pattern are skipped: only files are copied.
Each copied file is printed on stdout as
cp <source>, with the source path spelled as the pattern matched it.