Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
33 lines (26 sloc) 914 Bytes
require.paths.unshift "#{__dirname}/node_modules"
{spawn, exec} = require 'child_process'
{print} = require 'sys'
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', ->
task 'watch', 'Recompile CoffeScript when source files are modified', ->
build true
task 'test', 'Run the test suite', ->
build ->
require.paths.unshift __dirname + '/lib'
{reporters} = require 'nodeunit'
process.chdir __dirname ['test']
Something went wrong with that request. Please try again.