-
Notifications
You must be signed in to change notification settings - Fork 1
/
Cakefile
27 lines (20 loc) · 821 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
child_process = require 'child_process'
exec = child_process.exec
spawn = child_process.spawn
add_shebang = ->
exec 'echo "#!/usr/bin/env node" > raven-shell.js'
exec 'cat ./lib/shell.js >> raven-shell.js'
task 'build', 'Build project from src/*.coffee to lib/*.js', ->
exec 'coffee --compile --output lib/ src/', (err, stdout, stderr) ->
throw err if err
add_shebang()
console.log stdout + stderr
task 'watch', 'Watch src/*.coffee files and build them to lib/*.js when they change', ->
proc = spawn 'coffee', ['--compile', '--output', 'lib/', '--watch', 'src/']
proc.stdout.on 'data', (data) ->
add_shebang()
console.log data.toString()
proc.stderr.on 'data', (data) ->
console.error data.toString()
proc.on 'exit', (code) ->
console.log "watch exited with code #{code}"