-
Notifications
You must be signed in to change notification settings - Fork 34
/
make.js
executable file
·58 lines (46 loc) · 1.11 KB
/
make.js
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
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env node
require('shelljs/make');
var root = __dirname;
//
// Docs
//
target.docs = function() {
cd(root);
echo('_________________________________________________________________');
echo('Building docs');
var apiDocs = grep('//@',
'lib/core.js',
'lib/window.js',
'lib/canvas.js',
'lib/canvascontext2d.js',
'lib/image.js',
'lib/audiocontext.js',
'lib/audiobuffersource.js'
).replace(/ *\/\/\@ */g, '');
sed(/# API reference(.|\n)*/, '# API reference\n\n' + apiDocs, 'README.md').to('README.md');
}
//
// Test
//
target.test = function() {
cd(root);
echo('_________________________________________________________________');
echo('Running Node-Five tests');
echo();
cd('test');
rm('-f', 'img-test/*');
ls('*.js').forEach(function(f) {
echo('Running test file '+f);
exec('node '+f);
});
}
//
// Ref
//
target.ref = function() {
cd(root);
echo('_________________________________________________________________');
echo('Node-Five tests: Overwriting reference images');
rm('-f', 'img-ref/*');
mv('img-test/*', 'img-ref');
}