-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCakefile
More file actions
40 lines (33 loc) · 1.03 KB
/
Cakefile
File metadata and controls
40 lines (33 loc) · 1.03 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
fs = require 'fs'
{print} = require 'util'
{spawn} = require 'child_process'
build = (callback) ->
coffee = spawn 'coffee', ['-c', '-o', 'lib', 'src']
coffee.stderr.on 'data', (data) ->
process.stderr.write data.toString()
coffee.stdout.on 'data', (data) ->
console.log data.toString()
coffee.on 'exit', (code) ->
callback?() if code is 0
babel = (callback) ->
coffee = spawn 'npm', ['run', 'build']
coffee.stderr.on 'data', (data) ->
process.stderr.write data.toString()
coffee.stdout.on 'data', (data) ->
console.log data.toString()
coffee.on 'exit', (code) ->
callback?() if code is 0
run = (callback) ->
coffee = spawn 'node', ['lib/main.js']
coffee.stderr.on 'data', (data) ->
process.stderr.write data.toString()
coffee.stdout.on 'data', (data) ->
console.log data.toString()
coffee.on 'exit', (code) ->
callback?() if code is 0
task 'build', 'Build lib/ from src/', ->
build()
task 'run', 'Run main.js', ->
run()
task 'exec', 'Build everything and run main.js', ->
build run