File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ program
2323 . option ( '-c, --capture' , 'Enable capture mode' )
2424 . option ( '-v, --verbose' , 'Enable verbose mode' )
2525 . option ( '-d, --disable-mocks' , 'Temporary disable mocks to just use proxy' )
26+ . option ( '-i, --config-path <config-path>' , 'Custom config file path' , 'mock.config.js' )
2627 . parse ( process . argv ) ;
2728
2829function escapeRegExp ( str ) {
@@ -44,8 +45,10 @@ var defaultConfig = {
4445var config = defaultConfig ;
4546
4647try {
47- var loadedConfig = require ( path . resolve ( process . cwd ( ) , 'mock.config.js' ) ) ;
48- console . log ( 'Config file found mocking!' ) ;
48+ var configFilePath = path . resolve ( process . cwd ( ) , program . configPath ) ;
49+ var loadedConfig = require ( configFilePath ) ;
50+
51+ console . log ( `Config file found mocking! : ${ configFilePath } ` ) ;
4952
5053 config . map = { } ;
5154
You can’t perform that action at this time.
0 commit comments