forked from libgit2/node-gitteh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCakefile
30 lines (24 loc) · 1.1 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
{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.', ->
module.exports.passthru 'coffee', '-o', 'lib/', '-c', 'src/'
task 'test', 'Run the unit tests.', ->
module.exports.passthru 'mocha' # or your test runner
# exec 'mv NPM-index.js index.js; npm publish; mv index.js NPM-index.js'
task 'publish', 'Publish the NPM module.', ->
module.exports.passthru 'mv', 'NPM-index.js', 'index.js', (code) ->
module.exports.passthru 'npm', 'publish', '.', (code) ->
module.exports.passthru 'mv', 'index.js', 'NPM-index.js'
task "watch", "Watch coffee/ for changes and compile them to lib/", ->
module.exports.passthru "coffee", "-o", "lib/", "-w", "-c", "src/"