Skip to content

CTWorld/ycopy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ycopy

npm version

Installation

yarn add ycopy

Usage

ycopy [src] [dest] [options] [-f] [file-filters] [-r] [folder-filters]

Options

  • --version: Show version number.
  • -o, --overwrite: Overwrite existing file or directory, default is true. Note that the copy operation will silently fail if you set this to false and the destination exists. Use the errorOnExist option to change this behavior.
  • -e, --errorOnExist: When overwrite is false and the destination exists, throw an error. Default is false.
  • -s, --dereference: Dereference symlinks, default is false.
  • -t, --preserveTimestamps: Will set last modification and access times to the ones of the original source files, default is false.
  • -f, --filter-file: To filter copied files. If no filter is apply, all files will be reserved.
  • -r, --filter-folder: To filter copied folders. If no filter is apply, all folders will be reserved.
  • -d, --delete: Delete first before copy files. Default is false.
  • -i, --info: Show more info. Default is false.
  • -h, --help: Show help.

Copy behaviors is similiar with fs-extra's copy.

Example

ycopy test/a test/another/a -f .*\.txt .*\.jpg -r "^((?!cd$).)*$" -d -i

copy files and folders from test/a to test/another/a, which file is end with .txt or .jpg and folder is not end with sequence 'cd'.

About

A cli for copy files and folders

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published