Adds support for apps key in config file, throws if length is > 1

This commit is contained in:
Florent Vilmart
2016-03-11 09:42:33 -05:00
parent 9ea344abb7
commit 6e4357c6df

View File

@@ -38,7 +38,15 @@ let options = {};
if (program.args.length > 0 ) {
let jsonPath = program.args[0];
jsonPath = path.resolve(jsonPath);
options = require(jsonPath);
let jsonConfig = require(jsonPath);
if (jsonConfig.apps) {
if (jsonConfig.apps.length > 1) {
throw 'Multiple apps are not supported';
}
options = jsonConfig.apps[0];
} else {
options = jsonConfig;
}
console.log(`Configuation loaded from ${jsonPath}`)
}