-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cakefile
42 lines (33 loc) · 1.02 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
fs = require 'fs'
{print} = require 'sys'
{spawn, exec} = require 'child_process'
build = (callback) ->
exec "coffee -c -o . .",
(err, stdout, stderr) ->
if stdout?
print stdout
callback() if callback
print stderr if stderr?
buildTests = (callback) ->
exec "coffee -c -o test test",
(err, stdout, stderr) ->
if stdout?
print stdout
callback() if callback
print stderr if stderr?
test = (callback) ->
console.log "Running tests..."
exec "mocha --colors --require chai --reporter spec --recursive test",
(err, stdout, stderr) ->
if stdout?
print stdout
callback() if callback
print stderr if stderr?
task 'build', 'Compile *.coffee to *.js', ->
build()
task 'sbuild', 'Compile *.coffee to *.js using Sublime Text', ->
build()
task 'test', 'Build and run tests', ->
build ->
buildTests ->
test()