Skip to content
This repository has been archived by the owner on Apr 23, 2021. It is now read-only.

Commit

Permalink
Welcome message finished
Browse files Browse the repository at this point in the history
  • Loading branch information
pksunkara committed Apr 1, 2012
1 parent 16387ef commit 0c075b9
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions index.js
Expand Up @@ -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') {
Expand All @@ -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.