Permalink
Switch branches/tags
Find file
Fetching contributors…
Cannot retrieve contributors at this time
28 lines (22 sloc) 705 Bytes
{spawn} = require 'child_process'
{print} = require 'util'
fs = require 'fs'
spawnAndRun = (command, args, callback) ->
subproc = spawn(command, args)
subproc.stderr.on 'data', (data) ->
process.stderr.write data.toString()
subproc.stdout.on 'data', (data) ->
print data.toString()
subproc.on 'exit', (code) ->
callback?() if code is 0
test = (callback) ->
spawnAndRun 'jasmine-node', ['--coffee', 'spec'], callback
build = (callback) ->
fs.mkdir 'lib', 0o0755
print "compiling..."
spawnAndRun 'coffee', ['--compile', '--output', 'lib', 'src'], callback
print "\n"
task 'test', 'Run all tests', ->
test()
task 'build', 'Build the Javascript output', ->
build()