MCPcopy
hub / github.com/ajaxorg/ace / run

Function run

tool/update_deps.js:217–241  ·  view source on GitHub ↗
(cmd, cb)

Source from the content-addressed store, hash-verified

215};
216
217function run(cmd, cb) {
218 var proc = process.platform == "win32"
219 ? spawn("cmd", ["/c", cmd], {cwd: __dirname})
220 : spawn("bash", ["-c", cmd], {cwd: __dirname});
221
222 var result = "", err = "";
223 proc.stderr.setEncoding("utf8");
224 proc.stderr.on('data', function (data) {
225 err += data;
226 });
227
228 proc.stdout.setEncoding("utf8");
229 proc.stdout.on('data', function (data) {
230 result += data;
231 });
232
233 proc.on('close', done);
234 function done(code) {
235 if (code !== 0) {
236 console.error(cmd + '::: process exited with code :::' + code);
237 console.error(err)
238 }
239 cb(err, result)
240 }
241}
242
243function unquote(str) {
244 return str.replace(/\\(.)/g, function(x, a) {

Callers 2

browserifyFunction · 0.70
testVimFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected