2013-07-17 16:21:33 +08:00
|
|
|
var argv = require('optimist').argv;
|
2013-07-10 16:10:38 +08:00
|
|
|
var dialog = require('dialog');
|
2013-07-17 16:21:33 +08:00
|
|
|
var path = require('path');
|
2013-04-17 20:05:43 +08:00
|
|
|
|
2013-07-17 16:21:33 +08:00
|
|
|
// Start the specified app if there is one specified in command line, otherwise
|
|
|
|
// start the default app.
|
|
|
|
if (argv._.length > 0) {
|
|
|
|
process.on('uncaughtException', function() {
|
|
|
|
process.exit(1);
|
2013-04-18 23:50:47 +08:00
|
|
|
});
|
2013-05-07 16:20:52 +08:00
|
|
|
|
2013-07-17 16:21:33 +08:00
|
|
|
require(path.resolve(argv._[0]));
|
|
|
|
} else {
|
|
|
|
require('./default_app.js');
|
2013-04-15 15:39:54 +08:00
|
|
|
}
|