test null when populating webserver config derived from cli

This commit is contained in:
Michael Bradley, Jr 2018-09-17 17:50:13 -05:00
parent 638fb4ee27
commit 2b5268dc84
1 changed files with 12 additions and 5 deletions

View File

@ -56,17 +56,24 @@ class EmbarkController {
self.context = options.context || [constants.contexts.run, constants.contexts.build];
let Dashboard = require('./dashboard/dashboard.js');
let webServerConfig = {
enabled: options.runWebserver
};
const webServerConfig = {};
if (options.serverHost) {
if (options.runWebserver != null) {
webServerConfig.enabled = options.runWebserver;
}
if (options.serverHost != null) {
webServerConfig.host = options.serverHost;
}
if (options.serverPort) {
if (options.serverPort != null) {
webServerConfig.port = options.serverPort;
}
if (options.openBrowser != null) {
webServerConfig.openBrowser = options.openBrowser;
}
const Engine = require('../lib/core/engine.js');
const engine = new Engine({
env: options.env,