You use it by defining a projectwatch.cfg file(s) to your project directories. In the file you define what files should be monitored and what command should be executed when a change is detected.
Here's an example file
[My project Coffees] watchdir = ./src glob = *.coffee cmd = coffee --output js/ src/*
and now command
will go through every directory of your project looking for projectwatch.cfg files and will start monitors defined in those.
Because shells are intended for a one output only it gets very messy if you have several running applications on one shell. That's why Projectwatch comes with embedded webserver which provides a Webapp for your task viewing task statuses outputs. The app view is updated instantly as your tasks are being run. It works currently best in Chrome since it has good support for WebSockets.
Take a look at a screenshot here.
Commands that exits with non zero exitstatus are considered failing.
Some times tool creator has not thought through scripting use cases and we cannot detect whether the command succeeded. Use can provide your custom error checker regexp in projectwatch.cfg
error.stdout = error [0-9]+
Would match for "error 4" in the stdout of your command. You can similarly define checker for stderr.
Without parameters projectwatch will start searching from current working directory.
projectwatch.cfg is an ini-style configuration file.
[<monitor name>] watchdir = <directory to be monitored> glob = <glob matcher for files to be monitored> cmd = <command to be executed on changes> ; Optional settings error.stdout = <regexp> error.stderr = <regexp>
projectwatch.cfg files can have several monitors defined in them.
npm install -g projectwatch
Remove previous installation
npm uninstall -g projectwatch
Get the code
git clone firstname.lastname@example.org:epeli/Projectwatch.git
Link install it
cd Projectwatch npm link
Now projectwatch -command should use your code in the Projectwatch -directory. Now hack and send some cool pull requests via Github :)
GNU GENERAL PUBLIC LICENSE Version 3. See LICENCE.txt.
Todos before 1.0.0
- Use some nice command line option parser
- Notify about errors using HTML5 desktop notifications