embark/cmd
Pascal Precht df2aa30fb4
fix(core/cmd_controller): ensure webserver host and port aren't set to undefined
We've introduced a regression in 6d75a4c6c4 where running
`embark run` breaks due to webserver options not being defined.

The reason this happened is because in the mentioned commit, we're checking given
webserver options with an identity check against `null` and only set dedicated
options, if that condition is true.

E.g.:

```
if (options.runWebserver !== null) {
  webServerConfig.enabled = options.runWebserver;
}
```

Unfortunately, due to one of JavaScript design flaws, this condition behaves totally
different when no identity check is done, which causes Embark to break.

Meaning that in JavaScript:

```
undefined != null // false
undefined !== null // true
```

In other words, after the mentioned commit, the condition is true, resulting
in several webserver configurations to be set to `undefined`.

This conflicts at runtime when we compose webserver configurations out of user input
and Embark's defaults here: dc5de7c1b4/lib/core/config.js (L392)

In other words, since webserver config options are already set to `undefined`,
they don't get overridden by our config algorithm.

This commit ensures that webserver config values are not set when their values
are either `null` or `undefined`.
2018-10-22 19:54:50 +02:00
..
dashboard console, dashboard: Add persistent, automatically loaded history. 2018-10-22 19:54:43 +02:00
cmd.js use a customized require/.resolve instead of relying on NODE_PATH 2018-10-22 19:54:49 +02:00
cmd_controller.js fix(core/cmd_controller): ensure webserver host and port aren't set to undefined 2018-10-22 19:54:50 +02:00