forked from omarkhan/coffeedoc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cakefile
29 lines (25 loc) · 929 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
###
Coffeedoc Cakefile, adapted from [docco](http://jashkenas.github.com/docco/)
by jashkenas
###
exec = require('child_process').exec
path = require('path')
option '-p', '--prefix [DIR]', 'set the installation prefix for `cake install`'
task 'install', 'install the `coffeedoc` command into /usr/local (or --prefix)', (options) ->
base = options.prefix or '/usr/local'
lib = path.join(base, 'lib/coffeedoc')
exec([
'mkdir -p ' + lib
'cp -rf bin README.md resources src ' + lib
"ln -sf #{path.join(lib, 'bin/coffeedoc')} #{path.join(base, 'bin/coffeedoc')}"
].join(' && '), (err, stdout, stderr) ->
if err
process.stderr.write(stderr)
)
task 'test', 'run unit tests', (options) ->
exec('jasmine-node --coffee spec', (err, stdout, stderr) ->
if err
process.stderr.write(stderr)
else
process.stdout.write(stdout)
)