Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Switching from watch-tree to watchit for Node 0.6 compatibility

  • Loading branch information...
commit f5da50a6dc75491103d5af2769d349c36d7c3d66 1 parent aa88f9d
@TrevorBurnham authored
Showing with 9 additions and 6 deletions.
  1. +8 −5 Cakefile
  2. +1 −1  package.json
View
13 Cakefile
@@ -1,7 +1,7 @@
fs = require 'fs'
{print} = require 'sys'
child_process = require 'child_process'
-{watchTree} = require 'watch-tree'
+watchit = require 'watchit'
build = (watch, callback) ->
if typeof watch is 'function'
@@ -49,7 +49,10 @@ task 'test', 'Run the test suite (and re-run if anything changes)', ->
suite.stderr.on 'data', (data) -> print data.toString()
suite.on 'exit', -> suiteIndex++; runNextTestSuite()
invoke 'docs' # lest I forget
- testWatcher = watchTree 'test', 'sample-rate': 5
- testWatcher.on 'fileModified', runTests
- libWatcher = watchTree 'src', 'sample-rate': 5
- libWatcher.on 'fileModified', -> build(-> runTests())
+
+ watchTargets = (targets..., callback) ->
+ for target in targets
+ watchit target, include: true, (event) ->
+ callback() unless event is 'success'
+ watchTargets 'src', -> build runTests
+ watchTargets 'test', 'Cakefile', runTests
View
2  package.json
@@ -19,6 +19,6 @@
"devDependencies": {
"coffee-script": "1.1.2",
"nodeunit": "0.5.4",
- "watch-tree": "0.1.1"
+ "watchit": ">=0.0.1"
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.