12345678910111213141516171819202122 |
- 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.after('core-shell:cmd',(req,res,e) => {
- e.wait();
- var shcmd = req.cmd + " " + req.args.join(" ");
- var proc = child.exec(shcmd);
- res.write("\n");
- proc.stdout.pipe(res);
- proc.stderr.pipe(process.stderr);
- proc.on('close',function() {
- e.done();
- });
- });
- }
- module.exports.bundleStart = bundleStart;
|