forked from stripe-archive/jquery.payment
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cakefile
27 lines (21 loc) · 912 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
{spawn} = require 'child_process'
path = require 'path'
binPath = (bin) -> path.resolve(__dirname, "./node_modules/.bin/#{bin}")
runExternal = (cmd, args, callback = process.exit) ->
child = spawn(binPath(cmd), args, stdio: 'inherit')
child.on('error', console.error)
child.on('close', callback)
runSequential = (cmds, status = 0) ->
process.exit status if status or !cmds.length
cmd = cmds.shift()
cmd.push (status) -> runSequential cmds, status
runExternal.apply null, cmd
task 'build', 'Build lib/ from src/', ->
runExternal 'coffee', ['-c', '-o', 'lib', 'src']
task 'watch', 'Watch src/ for changes', ->
runExternal 'coffee', ['-w', '-c', '-o', 'lib', 'src']
task 'test', 'Run tests', ->
runSequential [
['mocha', ['--compilers', 'coffee:coffee-script/register', 'test/jquery.coffee']]
['mocha', ['--compilers', 'coffee:coffee-script/register', 'test/zepto.coffee']]
]