for --host,--port coerce falsy and bool to null

This commit is contained in:
Michael Bradley, Jr 2018-09-17 17:47:08 -05:00
parent 64027a5ee4
commit a966ecb131
1 changed files with 3 additions and 2 deletions

View File

@ -178,10 +178,11 @@ class Cmd {
.action(function(env, options) {
checkDeps();
i18n.setOrDetectLocale(options.locale);
const nullify = (v) => (!v || typeof v !== 'string') ? null : v;
embark.run({
env: env || 'development',
serverPort: options.port,
serverHost: options.host,
serverPort: nullify(options.port),
serverHost: nullify(options.host),
client: options.client || 'geth',
locale: options.locale,
runWebserver: !options.noserver,