1.0.1 • Published 4 years ago
watch-copy v1.0.1
watch-copy
watch-copy
listens to file changes (using
Watchman) and copy changed files to
another folder.
Install
npm install -g watch-copy
or
yarn global add watch-copy
Usage
Define a configuration file in any folder convenient to you, e.g.:
watch-copy.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:
$ watch-copy
The script will look for a configuration file named watch-copy.json
in the
current directory. You may specify the configuration file explicitly:
$ watch-copy ./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 watch-copy.json
.
License: MIT - do anything with the code, but don't blame me if it does not work.