-
Notifications
You must be signed in to change notification settings - Fork 26
/
Cakefile
43 lines (36 loc) · 1.26 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
42
43
{print} = require 'util'
{spawn} = require './spawn'
build = (callback) ->
coffee = spawn 'coffee', ['-c', '-o', './', 'scripts']
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
coffee = spawn 'coffee', ['-c', '-o', 'spec/', 'Spec']
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
watch = (callback) ->
coffee = spawn 'coffee', ['-w', '-c', '-o', './', 'scripts']
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
coffee = spawn 'coffee', ['-w', '-c', '-o', 'spec/', 'Spec']
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 application.js from srcipts/', ->
build()
task 'watch', 'Continuously compile application.js from scripts/', ->
watch()