diff --git a/lib/feflow.js b/lib/feflow.js index ec900eda..c60b97e3 100644 --- a/lib/feflow.js +++ b/lib/feflow.js @@ -1,6 +1,8 @@ 'use strict'; const Feflow = require('./core'); +const figlet = require('figlet'); +const chalk = require('chalk'); const minimist = require('minimist'); /** @@ -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 = ''; @@ -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';