A minimal utility for performing actions when something changes in the file system.
-
Full build
cpwatch does a sweep of the file system being monitored and passes every file / directory it finds to the corresponding Watcher. This is the basic "build all the things" mode.
-
Watch Mode
After doing a Full Build, cpwatch continues monitoring the file system for changes, notifying each Watcher of changes as needed. This is useful in local dev environments for keeping things in sync in realtime.
-
Check Mode
cpwatch only looks at files passed on the command line (i.e. no Full Build), and does not alter the filesystem. Instead, terminates with a non-zero exit if changes are needed. This is useful for pre-commit hooks (e.g. lefthook) to ensure files are up to date before committing changes to a repo.
Plugin API documentation forthcoming.