Skip to content

Commit c796317

Browse files
author
Martynas Žilinskas
committed
Added config checks for required arguments.
1 parent cc110b4 commit c796317

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/cli.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ class Cli {
4242
if (args.outDir != null) config.proxyjs.outDir = args.outDir;
4343
if (args.requireFile != null) config.proxyjs.requireFile = args.requireFile;
4444
if (config.baseDir == null) config.baseDir = '';
45+
if (config.proxyjs.outDir == null) {
46+
this.throwError('[Error] In proxyjs config `outDir` is undefined.');
47+
}
48+
if (config.proxyjs.requireFile == null) {
49+
this.throwError('[Error] In proxyjs config `requireFile` is undefined.');
50+
}
4551
return config;
4652
}
4753

0 commit comments

Comments
 (0)