-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile.js
51 lines (37 loc) · 1.09 KB
/
makefile.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
/**
* Sample TIBET-style makefile. Target functions are converted to promise
* objects so you can use then() to chain tasks easily. Use resolve or reject
* to notify when the target has completed.
*/
(function() {
'use strict';
var sh = require('shelljs');
// Uncomment to run node_modules-based utilities via shelljs.
// var nodeCLI = require('shelljs-nodecli');
// Uncomment to include TIBET's make helper routines for rollups.
// var helpers = require('tibet/src/tibet/cli/_make_helpers');
/**
* Canonical `targets` object for exporting the various target functions.
*/
var targets = {};
/**
* Run lint and test commands to verify the code is in good shape.
*/
targets.check = function(make) {
var result;
make.log('checking for lint...');
result = sh.exec('tibet lint');
if (result.code !== 0) {
targets.check.reject();
return;
}
make.log('running unit tests...');
result = sh.exec('tibet test');
if (result.code !== 0) {
targets.check.reject();
return;
}
targets.check.resolve();
};
module.exports = targets;
}());