0.1.1 • Published 4 years ago

wcp v0.1.1

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

wcp

wcp listens to file changes (using Watchman) and copy changed files to another folder.

Install

npm install -g wcp

or

yarn global add wcp

N.B. You may skip install if you use npx

Usage

Define a configuration file in any folder convenient to you, e.g.:

wcp.json

{
    projects: [
        {
            "src": "./SourceDir",
            "dest": "./DestinationDir",
            "ignore": ["node_modules/**", "__tests__/**"]
        }
    ]
}
  • Relative paths will be based on the configuration file's containing directory
  • Specify glob file patterns in ignore to avoid copying
Start the listener:
$ wcp

The script will look for a configuration file named wcp.json or wcp-config.json in the current directory. You may specify the configuration file explicitly:

$ wcp ./somewhere/else/watch-config.json

Ignored folders

Since the script uses Watchman behind the scene. Any ignored directories specified in Watchman configuration files will not be watched. However, Watchman configuration files will affect other processes watching the same folder with Watchman. Sometimes it is not possible to ignore directories with Watchman configuration files. In such case, you may specify the ignored file patterns in wcp.json.

License: MIT - do anything with the code, but don't blame me if it does not work.