-
Notifications
You must be signed in to change notification settings - Fork 3
/
make.js
45 lines (33 loc) · 1 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
(function(){
var fs = require('fs');
var jshint = require("jshint").JSHINT;
var version = fs.readFileSync('./version.txt', 'utf-8');
function getJSONFile (file) {
var str = fs.readFileSync(file, 'utf-8');
return JSON.parse(str);
}
function writeJSONFile (file, obj) {
fs.writeFile(file, JSON.stringify(obj, null, 4));
}
// Rewrite the package.json file with the appropriate version.
var packageFile = "./package.json";
var packageObj = getJSONFile(packageFile);
packageObj.version = version;
writeJSONFile(packageFile, packageObj);
var jshint_errors = [];
jshint(fs.readFileSync('./dist/minion-latest.js', "utf-8"), {node : true, browser: true});
jshint(fs.readFileSync('./lib/minion.js', "utf-8"), {node : true, browser: true});
console.log("");
console.log("");
if(jshint.errors.length > 0){
console.log("JSHINT FAILED : ");
console.log("");
console.log("");
console.log(jshint.errors);
}
else{
console.log("JSHINT PASSED");
}
console.log("");
console.log("");
})();