@metreeca/rack - v0.6.0
    Preparing search index...

    Function cp

    • 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: readonly string[]

        The glob patterns selecting the files to copy

      Returns void

      Shipping stylesheets next to the compiled modules, from an npm script:

      ush cp dist 'src/**/*.css'
      

      Patterns are quoted so that they reach the tool unexpanded, as shells differ in their glob support.

      TypeError If target is empty or if no pattern is provided

      Error If a pattern matches no file, in which case no file is copied for any of the patterns

    Index
    usage: string

    The command line synopsis of cp, printed by ush cp --help.