-
Notifications
You must be signed in to change notification settings - Fork 26
/
domain.js
41 lines (35 loc) · 1.04 KB
/
domain.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
/*global require, exports */
(function () {
"use strict";
var child_process = require("child_process"),
domainName = "builder.execute";
function exec(directory, command, callback) {
child_process.exec(command, { cwd: directory}, function (err, stdout, stderr) {
callback(err ? stderr : undefined, err ? undefined : stdout);
});
}
exports.init = function (DomainManager) {
if (!DomainManager.hasDomain(domainName)) {
DomainManager.registerDomain(domainName, {
major: 0,
minor: 1
});
}
DomainManager.registerCommand(domainName, "exec", exec, true, "Exec cmd",
[
{
name: "directory",
type: "string"
},
{
name: "command",
type: "string"
}
],
[{
name: "stdout",
type: "string"
}]
);
};
}());