File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,12 @@ if (!program.color) {
5151const log = require ( '../lib/log' ) ;
5252const output = require ( '../lib/output' ) ;
5353const madge = require ( '../lib/api' ) ;
54- const config = Object . assign ( rc , getPackageConfig ( ) ) ;
54+
55+ let packageConfig = { } ;
56+ try {
57+ packageConfig = require ( path . join ( process . cwd ( ) , 'package.json' ) ) . madge ;
58+ } catch ( e ) { }
59+ const config = Object . assign ( rc , packageConfig ) ;
5560
5661program . options . forEach ( ( opt ) => {
5762 const name = opt . name ( ) ;
@@ -132,14 +137,6 @@ function dependencyFilter() {
132137 } ;
133138}
134139
135- function getPackageConfig ( ) {
136- try {
137- return require ( path . join ( process . cwd ( ) , 'package.json' ) ) . madge ;
138- } catch ( err ) {
139- return { } ;
140- }
141- }
142-
143140new Promise ( ( resolve , reject ) => {
144141 if ( program . stdin ) {
145142 let buffer = '' ;
You can’t perform that action at this time.
0 commit comments