Permalink
Browse files

added watch

  • Loading branch information...
1 parent b6e94e7 commit 299aeeb9a9d7de41ac60fcdb9cffc3a6bec9d085 @cengebretson cengebretson committed Sep 20, 2012
Showing with 6 additions and 3 deletions.
  1. +6 −3 Cakefile
View
@@ -1,8 +1,8 @@
{print} = require 'util'
{spawn} = require 'child_process'
-build = (callback) ->
- coffee = spawn 'coffee', ['-c', '-o', 'lib', 'src']
+build = (callback, watch = false) ->
+ coffee = spawn 'coffee', [(if watch then '-cw' else '-c'), '-o', 'lib', 'src']
coffee.stderr.on 'data', (data) ->
process.stderr.write data.toString()
coffee.stdout.on 'data', (data) ->
@@ -11,4 +11,7 @@ build = (callback) ->
callback?() if code is 0
task 'build', 'Build lib/ from src/', ->
- build()
+ build()
+
+task 'watch', 'Watch lib/ from src/', ->
+ build(null, true)

0 comments on commit 299aeeb

Please sign in to comment.