|
@@ -9,20 +9,21 @@ var loaderActivator = {
|
|
start(context) {
|
|
start(context) {
|
|
this.context = context;
|
|
this.context = context;
|
|
this.manager = context.manager;
|
|
this.manager = context.manager;
|
|
-
|
|
|
|
this.runPath = context.manager.config.runPath;
|
|
this.runPath = context.manager.config.runPath;
|
|
|
|
+
|
|
|
|
+ this.registerShell(context);
|
|
|
|
+
|
|
|
|
+
|
|
if(!this.runPath ) {
|
|
if(!this.runPath ) {
|
|
log.warn("There is no runPath configured in manager");
|
|
log.warn("There is no runPath configured in manager");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
-
|
|
|
|
- // Check this out its wrong!?
|
|
|
|
context.on('core-installer:installed',() => {
|
|
context.on('core-installer:installed',() => {
|
|
- this.loadBundles();
|
|
|
|
|
|
+ this.loadBundles();
|
|
});
|
|
});
|
|
-
|
|
|
|
- this.registerShell(context);
|
|
|
|
-
|
|
|
|
|
|
+ //this.loadBundles();
|
|
|
|
+ // Check this out its wrong!?
|
|
|
|
+
|
|
},
|
|
},
|
|
loadBundles() {
|
|
loadBundles() {
|
|
var mods = fs.readdirSync(this.runPath);
|
|
var mods = fs.readdirSync(this.runPath);
|
|
@@ -41,8 +42,8 @@ var loaderActivator = {
|
|
},
|
|
},
|
|
|
|
|
|
registerShell(context) {
|
|
registerShell(context) {
|
|
- var prefix = context.prefix(".*:cmd"); // Any cmd sender
|
|
|
|
- prefix.on('lb',(req,res) => {
|
|
|
|
|
|
+ //var prefix = context.prefix(".*:cmd"); // Any cmd sender
|
|
|
|
+ context.on('core-shell:cmd:lb',(req,res) => {
|
|
var tbl = [];
|
|
var tbl = [];
|
|
for(var k in context.manager.registry) {
|
|
for(var k in context.manager.registry) {
|
|
var v = context.manager.registry[k];
|
|
var v = context.manager.registry[k];
|
|
@@ -79,32 +80,32 @@ var loaderActivator = {
|
|
}
|
|
}
|
|
return bcontext;
|
|
return bcontext;
|
|
}
|
|
}
|
|
- prefix.on('stop',(req,res) => {
|
|
|
|
|
|
+ context.on('core-shell:cmd:stop',(req,res) => {
|
|
var bcontext = commonGetBundle(req,res,1);
|
|
var bcontext = commonGetBundle(req,res,1);
|
|
if(bcontext == null) { return; }
|
|
if(bcontext == null) { return; }
|
|
bcontext.stop();
|
|
bcontext.stop();
|
|
|
|
|
|
});
|
|
});
|
|
- prefix.on('start',(req,res) => {
|
|
|
|
|
|
+ context.on('core-shell:cmd:start',(req,res) => {
|
|
var bcontext = commonGetBundle(req,res,1);
|
|
var bcontext = commonGetBundle(req,res,1);
|
|
if(bcontext == null) { return; }
|
|
if(bcontext == null) { return; }
|
|
bcontext.start();
|
|
bcontext.start();
|
|
});
|
|
});
|
|
|
|
|
|
- prefix.on('reload',(req,res) => {
|
|
|
|
|
|
+ context.on('core-shell:cmd:reload',(req,res) => {
|
|
var bcontext = commonGetBundle(req,res,1);
|
|
var bcontext = commonGetBundle(req,res,1);
|
|
if(bcontext == null) { return; }
|
|
if(bcontext == null) { return; }
|
|
var modulePath = bcontext.modulePath;
|
|
var modulePath = bcontext.modulePath;
|
|
context.manager.unregister(bcontext);
|
|
context.manager.unregister(bcontext);
|
|
context.manager.register({id:bcontext.id, name:bcontext.name, bundle:bcontext.modulePath});
|
|
context.manager.register({id:bcontext.id, name:bcontext.name, bundle:bcontext.modulePath});
|
|
});
|
|
});
|
|
- prefix.on('unload',(req,res) => {
|
|
|
|
|
|
+ context.on('core-shell:cmd:unload',(req,res) => {
|
|
var bcontext = commonGetBundle(req,res,1);
|
|
var bcontext = commonGetBundle(req,res,1);
|
|
if(bcontext == null) { return; }
|
|
if(bcontext == null) { return; }
|
|
context.manager.unregister(bcontext);
|
|
context.manager.unregister(bcontext);
|
|
});
|
|
});
|
|
|
|
|
|
- prefix.on('load',(req,res) => {
|
|
|
|
|
|
+ context.on('core-shell:cmd:load',(req,res) => {
|
|
if(req.args.length < 1) {
|
|
if(req.args.length < 1) {
|
|
res.write("Not enough parameters\n");
|
|
res.write("Not enough parameters\n");
|
|
return;
|
|
return;
|