-
Notifications
You must be signed in to change notification settings - Fork 0
/
cli.js
26 lines (25 loc) · 923 Bytes
/
cli.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
var childProcess = require("child_process"),
path = require("path");
module.exports = {
lint: function(options) {
var linterPath = null,
exportsCommand = process.env.SHELL + " -lc export";
childProcess.exec(exportsCommand, function(error, stdout) {
stdout.trim().split("\n").forEach(function(definition) {
var def = definition.split("=", 2);
if (def[0] === "MINDTOUCH_MTCPEXE_PATH") {
linterPath = def[1];
}
});
console.error("Linter Path = " + linterPath);
var linterBin = path.join(linterPath, "mtcp.exe");
childProcess.execFile("mono", [
linterBin,
"dekiscriptlint",
"-f", options.dekiFile
], {}, function(err, stdout) {
console.log(stdout);
});
});
}
};