File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -8,13 +8,10 @@ const getConfig = (altPath) => {
88 let configObject = json . readToObjSync ( pathString ) ;
99
1010 if ( ! configObject ) {
11- // package.json .rcs if no other config is found
12- configObject = json . readToObjSync ( path . join ( cwd , 'package.json' ) ) . sgc ;
13- }
14-
15- if ( ! configObject ) {
16- // if no config is available on the users project, the default settings should be used
17- configObject = json . readToObjSync ( path . join ( __dirname , '..' , '.sgcrc_default' ) ) ;
11+ // if package.json .rcs else .sgcrc_default
12+ const packageJson = json . readToObjSync ( path . join ( cwd , 'package.json' ) ) . sgc ;
13+ const sgcrcDefault = json . readToObjSync ( path . join ( __dirname , '..' , '.sgcrc_default' ) ) ;
14+ configObject = typeof packageJson === 'object' ? packageJson : sgcrcDefault ;
1815 }
1916
2017 return configObject ;
You can’t perform that action at this time.
0 commit comments