Skip to content

Instantly share code, notes, and snippets.

@Takazudo
Created February 17, 2012 17:03
Show Gist options
  • Save Takazudo/1854378 to your computer and use it in GitHub Desktop.
Save Takazudo/1854378 to your computer and use it in GitHub Desktop.
coffee cakefile
{print} = require 'util'
{spawn} = require 'child_process'
task 'build', 'Build lib/ from src/', ->
coffee = spawn 'coffee', ['-c', '-o', 'lib', 'src']
coffee.stderr.on 'data', (data) ->
process.stderr.write data.toString()
coffee.stdout.on 'data', (data) ->
print data.toString()
coffee.on 'exit', (code) ->
callback?() if code is 0
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()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment