Skip to content

Commit eef7768

Browse files
committed
opti: yapi-cli to yapi and fix install plugin findPlugin name bug
1 parent b4c8b69 commit eef7768

4 files changed

Lines changed: 6 additions & 3 deletions

File tree

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
22
"name": "yapi-cli",
3-
"version": "1.1.4",
3+
"version": "1.1.5",
44
"description": "",
55
"main": "index.js",
66
"bin": {
7-
"yapi-cli": "./bin/yapi-cli"
7+
"yapi-cli": "./bin/yapi-cli",
8+
"yapi" : "./bin/yapi-cli"
89
},
910
"scripts": {
1011
"test": "echo \"Error: no test specified\" && exit 1"

src/commands/plugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ module.exports = {
3737
let pluginName = name.substr('yapi-plugin-'.length)
3838
if (_.find(config.plugins, { name: pluginName })) {
3939
throw new Error('此插件已安装');
40-
} else if (_.find(config.plugins, pluginName)) {
40+
} else if (_.find(config.plugins, p=> p == pluginName)) {
4141
throw new Error('此插件已安装');
4242
}
4343
shell.cd('vendors');

src/commands/update.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ async function run(argv) {
3737
}else if (!_.find(versions.data, item => ('v' + item.version) === v)) {
3838
throw new Error('不存在的版本号,请执行 yapi-cli ls 查看版本号列表');
3939
}
40+
console.log('更新版本为' + v);
4041
let config = require(configFilepath);
4142
let npmInstall = 'npm install --production --registry https://registry.npm.taobao.org';
4243
if (config.plugins && Array.isArray(config.plugins) && config.plugins.length > 0) {

src/utils.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const semver = require('semver')
44
var utils;
55
function github(version) {
66
version = 'v' + utils.handleVersion(version);
7+
console.log('https://github.com/YMFE/yapi/archive/' + version + '.zip');
78
return 'https://github.com/YMFE/yapi/archive/' + version + '.zip';
89
}
910
module.exports = utils = {

0 commit comments

Comments
 (0)