wcp v0.1.1
wcp
wcp listens to file changes (using
Watchman) and copy changed files to
another folder.
Install
npm install -g wcpor
yarn global add wcpN.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
ignoreto avoid copying
Start the listener:
$ wcpThe 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.jsonIgnored 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.