Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: v1.0.6
Fetching contributors…

Cannot retrieve contributors at this time

file 32 lines (26 sloc) 0.917 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
#require.paths.unshift "#{__dirname}/node_modules"

{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 ->
        #require.paths.unshift __dirname + '/lib'
        {reporters} = require 'nodeunit'
        process.chdir __dirname
        reporters.default.run ['test']
Something went wrong with that request. Please try again.