Skip to content

Commit 6e4357c

Browse files
committed
Adds support for apps key in config file, throws if length is > 1
1 parent 9ea344a commit 6e4357c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/cli/parse-server.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,15 @@ let options = {};
3838
if (program.args.length > 0 ) {
3939
let jsonPath = program.args[0];
4040
jsonPath = path.resolve(jsonPath);
41-
options = require(jsonPath);
41+
let jsonConfig = require(jsonPath);
42+
if (jsonConfig.apps) {
43+
if (jsonConfig.apps.length > 1) {
44+
throw 'Multiple apps are not supported';
45+
}
46+
options = jsonConfig.apps[0];
47+
} else {
48+
options = jsonConfig;
49+
}
4250
console.log(`Configuation loaded from ${jsonPath}`)
4351
}
4452

0 commit comments

Comments
 (0)