Skip to content

Instantly share code, notes, and snippets.

@medicalwei
Created April 30, 2012 05:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save medicalwei/2555742 to your computer and use it in GitHub Desktop.
Save medicalwei/2555742 to your computer and use it in GitHub Desktop.
Cakefile used for every coffeescript project
fs = require 'fs'
{print} = require 'util'
{spawn} = require 'child_process'
build = (callback) ->
coffee = spawn 'coffee', ['-c', '-l', '.']
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 'build', 'Building scripts', ->
build()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment