forked from mcollina/shortshort.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cakefile
31 lines (23 loc) · 784 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
{ spawn } = require('child_process')
process = global.process
path = require('path')
runExternal = (command, callback) ->
console.log("Running #{command}")
child = spawn("/bin/sh", ["-c", command])
child.stdout.on "data", (data) -> process.stdout.write(data)
child.stderr.on "data", (data) -> process.stderr.write(data)
child.on('exit', callback) if callback?
launchSpec = (args...) ->
runExternal "./node_modules/.bin/mocha --compilers coffee:coffee-script " + args.join(" ")
task "spec", ->
launchSpec()
task "spec:ci", ->
launchSpec("--watch")
build = (cb = -> )->
runExternal "rm -rf ./lib", ->
runExternal "./node_modules/.bin/coffee -o lib -c src/*.coffee", cb
task "build", ->
build()
task "publish", ->
build ->
runExternal "npm publish"