Skip to content

Commit

Permalink
feat: print banner when no args
Browse files Browse the repository at this point in the history
  • Loading branch information
cpselvis committed Sep 9, 2017
1 parent 3597938 commit 3fff39c
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion lib/feflow.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
'use strict';

const Feflow = require('./core');
const figlet = require('figlet');
const chalk = require('chalk');
const minimist = require('minimist');

/**
Expand All @@ -23,6 +25,30 @@ function entry(args) {
process.exit(2);
}

/**
* Print banner
* Font preview:http://patorjk.com/software/taag/#p=display&f=3D-ASCII&t=feflow%0A
*
*/
function printBanner() {
figlet.text('feflow', {
font: '3D-ASCII',
horizontalLayout: 'default',
verticalLayout: 'default'
}, function(err, data) {
if (err) {
log.info('Something went wrong...');
log.error(err);
return;
}

console.log(chalk.cyan(data));
console.log(chalk.cyan(` Feflow,当前版本v${feflow.version}, 让开发工作流程更简单,主页: https://github.com/iv-web/feflow-cli `));
console.log(chalk.cyan(' (c) powered by IVWEB Team '));
console.log(chalk.cyan(' Run feflow --help to see usage. '));
});
}

return feflow.init().then(function() {
let cmd = '';

Expand All @@ -36,7 +62,8 @@ function entry(args) {
let c = feflow.cmd.get(cmd);
if (!c) cmd = 'help';
} else {
cmd = 'help';
printBanner();
return;
}
} else {
cmd = 'help';
Expand Down

0 comments on commit 3fff39c

Please sign in to comment.