1.0.1 • Published 5 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-copyor
yarn global add watch-copyUsage
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
ignoreto avoid copying
Start the listener:
$ watch-copyThe 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.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 watch-copy.json.
License: MIT - do anything with the code, but don't blame me if it does not work.