forked from lanhebe/shadowsocks-heroku
-
Notifications
You must be signed in to change notification settings - Fork 552
/
Cakefile
34 lines (30 loc) · 883 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
31
32
33
34
{spawn} = require 'child_process'
build = (callback) ->
os = require 'os'
if os.platform() == 'win32'
coffeeCmd = 'coffee.cmd'
else
coffeeCmd = 'coffee'
coffee = spawn coffeeCmd, ['-c', '-o', '.', 'src']
coffee.stderr.on 'data', (data) ->
process.stderr.write data.toString()
coffee.stdout.on 'data', (data) ->
console.log data.toString()
coffee.on 'exit', (code) ->
console.log 'build completed'
callback?() if code is 0
process.exit code
test = (callback) ->
os = require 'os'
coffee = spawn 'node', ['test.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
process.exit code
task 'build', 'Build ./ from src/', ->
build()
task 'test', 'Run unit test', ->
test()