File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "name" : " yapi-cli" ,
3- "version" : " 1.1.5 " ,
3+ "version" : " 1.1.6@rc " ,
44 "description" : " " ,
55 "main" : " index.js" ,
66 "bin" : {
7- "yapi-cli " : " ./bin/yapi-cli" ,
8- "yapi" : " ./bin/yapi-cli"
7+ "yapi" : " ./bin/yapi-cli" ,
8+ "yapi-cli" : " ./bin/yapi-cli"
99 },
1010 "scripts" : {
1111 "test" : " echo \" Error: no test specified\" && exit 1"
Original file line number Diff line number Diff line change @@ -35,9 +35,14 @@ module.exports = {
3535 }
3636
3737 let pluginName = name . substr ( 'yapi-plugin-' . length )
38- if ( _ . find ( config . plugins , { name : pluginName } ) ) {
39- throw new Error ( '此插件已安装' ) ;
40- } else if ( _ . find ( config . plugins , p => p == pluginName ) ) {
38+ if ( _ . find ( config . plugins , plugin => {
39+ if ( ! plugin ) return null ;
40+ if ( typeof plugin === 'string' ) {
41+ return plugin == pluginName ;
42+ } else if ( typeof plugin === 'object' ) {
43+ return plugin . name == pluginName
44+ }
45+ } ) ) {
4146 throw new Error ( '此插件已安装' ) ;
4247 }
4348 shell . cd ( 'vendors' ) ;
You can’t perform that action at this time.
0 commit comments