-
Notifications
You must be signed in to change notification settings - Fork 24
/
Cakefile
36 lines (31 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
31
32
33
34
35
36
{spawn, exec} = require 'child_process'
option '-p', '--prefix [DIR]', 'set the installation prefix for `cake install`'
task 'build', 'continually build the docco library with --watch', ->
coffee = spawn 'coffee', ['-cw', '-o', 'lib', 'src']
coffee.stdout.on 'data', (data) -> console.log data.toString().trim()
task 'install', 'install the `docco` command into /usr/local (or --prefix)', (options) ->
base = options.prefix or '/usr/local'
lib = base + '/lib/docco-husky'
exec([
'mkdir -p ' + lib
'cp -rf bin README resources vendor lib ' + lib
'ln -sf ' + lib + '/bin/generate ' + base + '/bin/docco-husky'
].join(' && '), (err, stdout, stderr) ->
if err then console.error stderr
)
task 'doc', 'rebuild the Docco documentation', ->
exec([
'bin/generate src/docco.coffee'
'sed "s/docco.css/resources\\/docco.css/" < docs/docco.html > index.html'
'rm -r docs'
].join(' && '), (err) ->
throw err if err
)
task 'test', 'test the doc generator', ->
exec([
'rm -rf test/docs'
'cd test'
'../bin/generate .'
].join(' && '), (err) ->
throw err if err
)