Skip to content
This repository

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

file 27 lines (23 sloc) 0.876 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
{spawn, exec} = require 'child_process'
fs = require 'fs'

task 'build', 'build the whole jam', (cb) ->
  console.log "Building"
  files = fs.readdirSync 'src'
  files = ('src/' + file for file in files when file.match(/\.coffee$/))
  clearLibJs ->
    runIced ['-I', 'inline', '-c', '-o', 'lib/'].concat(files), ->
      runIced ['-I', 'inline', '-c', 'index.coffee'], ->
        console.log "Done building."
        cb() if typeof cb is 'function'


runIced = (args, cb) ->
  proc = spawn 'iced', args
  console.log args
  proc.stderr.on 'data', (buffer) -> console.log buffer.toString()
  proc.on 'exit', (status) ->
    process.exit(1) if status != 0
    cb() if typeof cb is 'function'

clearLibJs = (cb) ->
  files = fs.readdirSync 'lib'
  files = ("lib/#{file}" for file in files when file.match(/\.js$/))
  fs.unlinkSync f for f in files
  cb()
Something went wrong with that request. Please try again.