Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updating Cakefile for node 0.6+

  • Loading branch information...
commit b244d1f582b6207211dc34ed4700ac7d72f1f7a6 1 parent 69f0de0
@TrevorBurnham authored
Showing with 9 additions and 7 deletions.
  1. +8 −6 Cakefile
  2. +1 −1  package.json
View
14 Cakefile
@@ -1,7 +1,7 @@
fs = require 'fs'
-{print} = require 'sys'
+{print} = require 'util'
{spawn, exec} = require 'child_process'
-{watchTree} = require 'watch-tree'
+watchit = require 'watchit'
build = (watch, callback) ->
if typeof watch is 'function'
@@ -43,7 +43,9 @@ 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
@@ -15,6 +15,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.