diff --git a/bin/mojito b/bin/mojito index 1a08c0fc1..74f5fb97b 100755 --- a/bin/mojito +++ b/bin/mojito @@ -4,7 +4,9 @@ * Copyrights licensed under the New BSD License. * See the accompanying LICENSE file for terms. */ -var resolve = require('path').resolve, +var cli, + resolve = require('path').resolve, mojito = require(resolve(__dirname, '../lib/mojito')); -mojito.include('management/cli'); +cli = mojito.include('management/cli'); +cli.run(); diff --git a/lib/management/cli.js b/lib/management/cli.js index d99908d0d..228c3f3d0 100644 --- a/lib/management/cli.js +++ b/lib/management/cli.js @@ -132,7 +132,4 @@ function main() { }); } -// Execute the main() function. Note that this occurs as part of the -// require/import process so simply importing/require()ing the cli.js will cause -// the main() operation to be invoked. -main(); +exports.run = main;