-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCakefile
31 lines (24 loc) · 1.14 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
# from https://github.com/libgit2/node-gitteh/blob/master/Cakefile
{spawn} = require 'child_process'
showinfo = (args) -> console.info("Spawn: ", args.join(" "))
module.exports =
passthru: (args...) ->
callback = ->
callback = args.pop() if "function" == typeof args[args.length-1]
showinfo(args)
proc = spawn '/usr/bin/env', args
proc.stdout.pipe process.stdout
proc.stderr.pipe process.stderr
proc.on 'exit', (code) ->
console.info("Exited with status: " + code) if code
callback(code)
task 'build', 'Compile CoffeeScript to JavaScript.', build = (cb) ->
module.exports.passthru 'coffee', '-o', 'lib/', '-c', 'src/' , (codes) ->
module.exports.passthru 'cp', 'src/lang_codes.js', 'lib/', cb
task 'publish', 'Build and Version and Publish', ->
build ->
module.exports.passthru 'npm', 'publish'
task 'test', 'Run the unit tests.', ->
module.exports.passthru './node_modules/.bin/mocha', '--compilers', 'coffee:coffee-script', './test/test.coffee'
task "watch", "Watch coffee/ for changes and compile them to lib/", ->
module.exports.passthru "coffee", "-o", "lib/", "-w", "-c", "src/"