36 lines
875 B
JavaScript
36 lines
875 B
JavaScript
/**
|
||
npm config get registry // 先康康你的是否是npm官方的源,不是请切回
|
||
npm config set registry https://registry.npmmirror.com
|
||
npm config set registry https://registry.npmjs.org
|
||
*/
|
||
|
||
const { program } = require('commander'); // 命令行提示工具
|
||
const figlet = require('figlet'); // 生成艺术字
|
||
|
||
module.exports = {
|
||
/**
|
||
* 给help信息添加提示
|
||
*/
|
||
CommandLogHelp() {
|
||
program.on('--help', function () {
|
||
console.log(
|
||
// 设置帮助信息下打印艺术字
|
||
figlet.textSync('Bunny-Cli', {
|
||
font: 'Ghost',
|
||
horizontalLayout: 'default',
|
||
verticalLayout: 'default',
|
||
width: 100,
|
||
whitespaceBreak: true,
|
||
}),
|
||
);
|
||
});
|
||
},
|
||
/**
|
||
* 给出version版本号
|
||
*/
|
||
CommandLogStart() {
|
||
program.name('bunny-cli').usage('<command> [options]');
|
||
program.version(`😉 v${require('../package.json').version}`);
|
||
},
|
||
};
|