Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

30 lines (24 sloc) 0.815 kb
{spawn, exec} = require 'child_process'
{print} = require 'util'
build = (watch, callback) ->
if typeof watch is 'function'
callback = watch
watch = false
options = ['-c', '-o', 'lib', 'src']
options.unshift '-w' if watch
coffee = spawn 'coffee', options
coffee.stdout.on 'data', (data) ->
print data.toString()
coffee.stderr.on 'data', (data) ->
print data.toString()
coffee.on 'exit', (status) ->
callback?() if status is 0
task 'build', 'Compile CoffeScript source files', ->
build()
task 'watch', 'Recompile CoffeScript when source files are modified', ->
build true
task 'test', 'Run the test suite', ->
build ->
{reporters} = require 'nodeunit'
process.chdir __dirname
reporters.default.run ['test']
Jump to Line
Something went wrong with that request. Please try again.