-
Notifications
You must be signed in to change notification settings - Fork 1
/
Cakefile
35 lines (31 loc) · 1.15 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
{spawn, exec} = require 'child_process'
build = (watch) ->
folders = ['test/', {s: 'src/', o: 'lib/'}, 'testconfig.coffee']
buildFolder folder, watch for folder in folders
buildFolder = (folder, watch) ->
if typeof folder is 'string'
options = ['-c', folder]
else
options = ['-c', '-o', folder.o, folder.s]
if watch is true
options[0] = '-cw'
watcher = spawn 'coffee', options
watcher.stdout.on 'data', (data) ->
console.log data.toString().trim()
watcher.stderr.on 'data', (data) ->
console.log data.toString().trim()
watcher = spawn 'node_modules\\.bin\\coffee.cmd', options
watcher.stdout.on 'data', (data) ->
console.log data.toString().trim()
watcher.stderr.on 'data', (data) ->
console.log data.toString().trim()
watcher.on 'error', (error) ->
watcher = spawn 'node_modules\\.bin\\coffee.cmd', options
watcher.stdout.on 'data', (data) ->
console.log data.toString().trim()
watcher.stderr.on 'data', (data) ->
console.log data.toString().trim()
task 'build', 'build the project', (watch) ->
build false
task 'watch', 'watch the libs and controllers folders', () ->
build true