forked from moul/node-icecast-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCakefile
28 lines (23 loc) · 895 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
{spawn, exec} = require 'child_process'
call = (command, args = [], fn = null) ->
exec "#{command} #{args.join(' ')}", (err, stdout, stderr) ->
if err?
console.error "Error :"
return console.dir err
fn err if fn
system = (command, args) ->
spawn command, args, stdio: "inherit"
build = (fn = null) ->
call 'coffee', ['-c', '-o', 'lib', 'src']
call 'coffee', ['-c', '-o', 'examples', 'examples']
call 'browserify', ['src/BrowserEntry.coffee', '-o', 'browser/icecast-admin.js'], ->
call "minifyjs", ['--engine', 'yui', '--level', '2', 'browser/icecast-admin.js', '>', 'browser/icecast-admin.min.js'], fn
task 'build', 'continually build the JavaScript code', ->
build ->
console.log "Done !"
task 'doc', 'rebuild the Docco documentation', ->
exec([
'docco src/*.coffee'
].join(' && '), (err) ->
throw err if err
)