Merge pull request #632 from embark-framework/bug_fix/run_flags_round_2

don't forward host/port cli options if the options weren't specified
This commit is contained in:
Michael Bradley 2018-07-17 19:40:37 -05:00 committed by GitHub
commit 328399bd9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 5 deletions

View File

@ -65,6 +65,17 @@ class Embark {
self.context = options.context || [constants.contexts.run, constants.contexts.build];
let Dashboard = require('./dashboard/dashboard.js');
let webServerConfig = {
enabled: options.runWebserver
};
if (options.serverHost) {
webServerConfig.host = options.serverHost;
}
if (options.serverPort) {
webServerConfig.port = options.serverPort;
}
const Engine = require('./core/engine.js');
const engine = new Engine({
env: options.env,
@ -76,11 +87,7 @@ class Embark {
logLevel: options.logLevel,
context: self.context,
useDashboard: options.useDashboard,
webServerConfig: {
enabled: options.runWebserver,
host: options.serverHost,
port: options.serverPort
}
webServerConfig: webServerConfig
});
engine.init();