Repository navigation
Expand file tree
/
Copy pathCakefile
More file actions
48 lines (36 loc) · 1.29 KB
/
Copy pathCakefile
File metadata and controls
48 lines (36 loc) · 1.29 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
require 'shortcake'
use require 'cake-version'
use require 'cake-publish'
option '-g', '--grep [filter]', 'test filter'
option '-t', '--test', 'test specific module'
task 'build', 'build project', ->
yield exec 'node_modules/.bin/coffee -bcm -o lib/ src/'
task 'test', 'run tests', (opts, done) ->
grep = if opts.grep then "--grep #{opts.grep}" else ''
test = opts.test ? 'test/'
yield exec "NODE_ENV=test node_modules/.bin/mocha
--colors
--reporter spec
--timeout 5000
--compilers coffee:coffee-script/register
--require postmortem/register
--require co-mocha
#{grep}
#{test}"
task 'watch', 'watch for changes and rebuild project', ->
exec 'node_modules/.bin/coffee -bcmw -o lib/ src/'
task 'watch:test', 'watch for changes and rebuild, rerun tests', (options) ->
invoke 'watch'
require('vigil').watch __dirname, (filename) ->
return if running 'test'
if /^src/.test filename
invoke 'test'
if /^test/.test filename
invoke 'test', test: filename
task 'publish', 'Publish project', ->
# require('brief').update()
exec.parallel '''
git push
git push --tags
npm publish
'''