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 47 lines (37 sloc) 1.434 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 33 34 35 36 37 38 39 40 41 42 43 44 45 46
fs = require 'fs'
{exec} = require 'child_process'
browserify = require 'browserify'


task 'build:jsbundle', 'Compile the Bolo client JavaScript bundle', ->
  b = browserify()
  b.require './src/client', root: __dirname
  fs.writeFileSync 'js/bolo-bundle.js', b.bundle()

task 'build:manifest', 'Create the manifest file', ->
  dirtytag = Math.round(Math.random() * 10000)
  exec "git describe --always --dirty=-#{dirtytag}", (error, stdout) ->
    throw error if error
    rev = stdout.trim()

    images = ''
    for file in fs.readdirSync 'images/'
      images += "images/#{file}\n" unless file.match /\.gz$/

    sounds = ''
    for file in fs.readdirSync 'sounds/'
      sounds += "sounds/#{file}\n" unless file.match /\.gz$/

    fs.writeFileSync 'bolo.manifest',
      """
CACHE MANIFEST
# Version #{rev}

index.html
http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/themes/base/jquery.ui.all.css
css/bolo.css
css/jquery.ui.theme.css
https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js
https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/jquery-ui.min.js
bolo-bundle.js
http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png

#{images}
#{sounds}
"""

task 'build', 'Compile Bolo', ->
  invoke 'build:jsbundle'
  # FIXME: use applicationCache again.
  #invoke 'build:manifest'
Something went wrong with that request. Please try again.