2016-06-26 11:53:19 +00:00
|
|
|
#!/usr/bin/env node
|
|
|
|
|
|
|
|
// Add ability to load AMD modules
|
|
|
|
require("amd-loader");
|
|
|
|
|
2017-04-02 12:12:51 +00:00
|
|
|
// Architect
|
|
|
|
var architect = require("architect");
|
|
|
|
|
2016-06-26 11:53:19 +00:00
|
|
|
|
|
|
|
architect.resolveConfig(require("../configs/cli.js")(),
|
|
|
|
__dirname + "/../plugins", function (err, config) {
|
|
|
|
if (err) throw err.message;
|
|
|
|
|
|
|
|
var cli;
|
|
|
|
var app = architect.createApp(config, function(err, app){
|
|
|
|
if (err) throw err;
|
|
|
|
|
|
|
|
cli.start();
|
|
|
|
});
|
|
|
|
app.on("service", function(name, plugin){
|
|
|
|
if (name == "cli")
|
|
|
|
cli = plugin;
|
|
|
|
|
|
|
|
if (!plugin.name)
|
|
|
|
plugin.name = name;
|
|
|
|
});
|
|
|
|
});
|