Permalink
Browse files

Welcome message finished

  • Loading branch information...
1 parent 16387ef commit 0c075b9c1bbb09cee8243c8ceb24adb9fbc2a45f @pksunkara committed Apr 1, 2012
Showing with 11 additions and 11 deletions.
  1. +11 −11 index.js
View
@@ -12,23 +12,14 @@ var cliOk = exports = module.exports;
cliOk.name = 'cli-ok';
cliOk.attach = function (options) {
- var app = this, logger;
+ var app = this;
options = options || {};
if (!app.plugins.cli) {
throw new Error('`cli` plugin is required to use `flatiron-cli-ok`');
}
var start = app.start;
- // var init = app.init;
-
- // app.init = function (options, cb) {
- // init(options || {}, function (err) {
- // app.log.info('Welcome to ' + app.name.grey);
- // app.log.info('It worked if it ends with ' + app.name.grey + ' ok'.green.bold);
- // cb(err);
- // });
- // };
app.start = function (options, cb) {
if (!cb && typeof options == 'function') {
@@ -39,11 +30,20 @@ cliOk.attach = function (options) {
start(options || {}, function (err) {
if (cb) return cb(err);
if (err) {
- app.log.info(app.name.grey + ' ' + 'not ok'.red.bold);
+ app.log.info(app.name.grey + ' ' + 'not'.red.bold + ' ' + 'ok'.red.bold);
} else {
app.log.info(app.name.grey + ' ' + 'ok'.green.bold);
}
});
};
};
+
+cliOk.init = function (done) {
+ var app = this;
+
+ app.log.info('Welcome to ' + app.name.grey);
+ app.log.info('It worked if it ends with ' + app.name.grey + ' ' + 'ok'.green.bold);
+
+ done();
+};

0 comments on commit 0c075b9

Please sign in to comment.