forked from omarkhan/coffeedoc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cakefile
23 lines (19 loc) · 816 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
###
Coffeedoc Cakefile, adapted from [docco](http://jashkenas.github.com/docco/)
by jashkenas
###
{spawn, exec} = require 'child_process'
option '-p', '--prefix [DIR]', 'set the installation prefix for `cake install`'
task 'build', 'continually build the coffeedoc library with --watch', ->
coffee = spawn 'coffee', ['-cw', '-o', 'lib', 'src']
coffee.stdout.on 'data', (data) -> console.log data.toString().trim()
task 'install', 'install the `coffeedoc` command into /usr/local (or --prefix)', (options) ->
base = options.prefix or '/usr/local'
lib = base + '/lib/coffeedoc'
exec([
'mkdir -p ' + lib
'cp -rf bin README.md resources lib ' + lib
'ln -sf ' + lib + '/bin/coffeedoc ' + base + '/bin/coffeedoc'
].join(' && '), (err, stdout, stderr) ->
if err then console.error stderr
)