Permalink
Browse files

added scripts folder to tasks

  • Loading branch information...
1 parent 572509b commit bfa584b7cc4985db8bb55dc301b89c703ce87030 @fent fent committed Aug 3, 2011
Showing with 10 additions and 7 deletions.
  1. +10 −7 Cakefile
View
@@ -1,13 +1,16 @@
{spawn, exec} = require('child_process')
+execcb = (err, stdout, stderr) ->
+ throw err if err
+
+datacb = (data) ->
+ console.log data.toString().replace /\s+$/, ''
+
task 'build', 'Build project from src/*.coffee to lib/*.js', ->
- exec 'coffee -o lib -c src', (err, stdout, stderr) ->
- throw err if err
- console.log stdout + stderr
+ exec 'coffee -o lib -c src', execcb
+ exec 'coffee -c scripts', execcb
task 'watch', 'Build and watch for changes', ->
child = spawn 'coffee', ['-w', '-o', 'lib', '-c', 'src']
- child.stdout.on 'data', (data) ->
- console.log data.toString().replace /\s+$/, ''
- child.stderr.on 'data', (data) ->
- console.log data.toString()
+ child.stdout.on 'data', datacb
+ child.stderr.on 'data', datacb

0 comments on commit bfa584b

Please sign in to comment.