File tree Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -23,13 +23,21 @@ const configFilepath = program.args[0] || defaultConfigFilepath;
2323// Load and validate configuration.
2424const ajv = new Ajv ( ) ;
2525addAjvFormats ( ajv ) ;
26- const config = Object . assign (
27- {
28- localApps : [ ] ,
29- remoteUrl : "https://lw.gocho.live" ,
30- } ,
31- require ( path . resolve ( configFilepath ) ) ,
32- ) ;
26+ let config ;
27+ try {
28+ config = Object . assign (
29+ {
30+ localApps : [ ] ,
31+ remoteUrl : "https://lw.gocho.live" ,
32+ } ,
33+ require ( path . resolve ( configFilepath ) ) ,
34+ ) ;
35+ } catch ( error ) {
36+ if ( error . code === "MODULE_NOT_FOUND" ) {
37+ throw new Error ( `Configuration file not found: ${ configFilepath } ` ) ;
38+ }
39+ throw error ;
40+ }
3341const isConfigValid = ajv . validate (
3442 require ( "../../schemas/config-schema.json" ) ,
3543 config ,
You can’t perform that action at this time.
0 commit comments