Skip to content

Commit

Permalink
Add watch task to compile the CoffeeScript
Browse files Browse the repository at this point in the history
  • Loading branch information
maccman committed Feb 13, 2012
1 parent e1da9d5 commit b727e88
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Cakefile
@@ -1,7 +1,7 @@
{print} = require 'util'
{spawn} = require 'child_process'

build = (callback) ->
task 'build', 'Build lib/ from src/', ->
coffee = spawn 'coffee', ['-c', '-o', 'lib', 'src']
coffee.stderr.on 'data', (data) ->
process.stderr.write data.toString()
Expand All @@ -10,5 +10,9 @@ build = (callback) ->
coffee.on 'exit', (code) ->
callback?() if code is 0

task 'build', 'Build lib/ from src/', ->
build()
task 'watch', 'Watch src/ for changes', ->
coffee = spawn 'coffee', ['-w', '-c', '-o', 'lib', 'src']
coffee.stderr.on 'data', (data) ->
process.stderr.write data.toString()
coffee.stdout.on 'data', (data) ->
print data.toString()

0 comments on commit b727e88

Please sign in to comment.