Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 33 lines (25 sloc) 1.045 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
# Build script adpated from http://github.com/jashkenas/coffee-script/Cakefile
# ==============================================================================

fs = require 'fs'
util = require 'util'
CoffeeScript = require 'coffee-script'
{spawn, exec} = require 'child_process'


# ANSI terminal colors.
red = '\033[0;31m'
green = '\033[0;32m'
reset = '\033[0m'

# Commands
compressionCmd = ->
  "java -jar ./lib/compiler.jar --js data.js --js_output_file data.min.js"

# Run a CoffeeScript through the node/coffee interpreter.
run = (args) ->
  proc = spawn 'bin/coffee', args
  proc.stderr.on 'data', (buffer) -> puts buffer.toString()
  proc.on 'exit', (status) -> process.exit(1) if status != 0

# Log a message with a color.
log = (message, color, explanation) ->
  console.log "#{color or ''}#{message}#{reset} #{explanation or ''}"

task 'build', 'Build a compressed version', ->
  exec compressionCmd(), (err, stdout, stderr) ->
    throw err if err
    log 'Sucessfully built data.min.js', green
Something went wrong with that request. Please try again.