var log = require('hlogger').createLogger('shell-test'); var child = require('child_process'); function bundleStart(context) { log.info("Command provider installed"); // Create a bash and transport commands context.events .channel('core-shell') .after('cmd',(req,res,e) => { if(e.count != 0) return; e.wait(); var shcmd = req.cmd + " " + req.args.join(" "); var proc = child.exec(shcmd); proc.stdout.pipe(res); proc.stderr.pipe(process.stderr); proc.on('close',function() { e.done(); }); }); } module.exports.bundleStart = bundleStart;