Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

32 lines (26 sloc) 1.0 kb
{spawn, exec} = require 'child_process'
log = console.log
task 'build', "Compiles to JavaScript", ->
run 'coffee -o dist -c lib/*.coffee'
task 'test', "Testing using Jasmine-Node", ->
run 'jasmine-node test/async.spec.coffee --verbose --color --forceexit --coffee'
task 'dev', "Start developing stuff", ->
run 'npm install'
invoke 'test'
invoke 'docs'
task 'docs', "Create documenations using Docco", ->
run 'docco lib/*.coffee'
run = (args...) ->
for a in args
switch typeof a
when 'string' then command = a
when 'object'
if a instanceof Array then params = a
else options = a
when 'function' then callback = a
command += ' ' + params.join ' ' if params?
cmd = spawn '/bin/sh', ['-c', command], options
cmd.stdout.on 'data', (data) -> process.stdout.write data
cmd.stderr.on 'data', (data) -> process.stderr.write data
process.on 'SIGHUP', -> cmd.kill()
cmd.on 'exit', (code) -> callback() if callback? and code is 0
Jump to Line
Something went wrong with that request. Please try again.