forked from erictrinh/jsbomberman
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cakefile
30 lines (25 loc) · 918 Bytes
/
Cakefile
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
fs = require 'fs'
{print} = require 'util'
{spawn} = require 'child_process'
build = (callback) ->
coffee = spawn 'coffee', ['-c', '-o', 'js', 'coffee']
coffee.stderr.on 'data', (data) ->
process.stderr.write data.toString()
coffee.stdout.on 'data', (data) ->
print data.toString()
coffee.on 'exit', (code) ->
callback?() if code is 0
task 'build', 'Build js/ from coffee/', ->
build()
task 'watch', 'Watch coffee/ for changes', ->
coffee = spawn 'coffee', ['-w', '-c', '-o', 'js', 'coffee']
coffee.stderr.on 'data', (data) ->
process.stderr.write data.toString()
coffee.stdout.on 'data', (data) ->
print data.toString()
task 'barewatch', 'Watch coffee/ for changes', ->
coffee = spawn 'coffee', ['-w', '-b', '-o', 'js', 'coffee']
coffee.stderr.on 'data', (data) ->
process.stderr.write data.toString()
coffee.stdout.on 'data', (data) ->
print data.toString()