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) { .action(function(env, options) {
checkDeps(); checkDeps();
i18n.setOrDetectLocale(options.locale); i18n.setOrDetectLocale(options.locale);
const nullify = (v) => (!v || typeof v !== 'string') ? null : v;
embark.run({ embark.run({
env: env || 'development', env: env || 'development',
serverPort: options.port, serverPort: nullify(options.port),
serverHost: options.host, serverHost: nullify(options.host),
client: options.client || 'geth', client: options.client || 'geth',
locale: options.locale, locale: options.locale,
runWebserver: !options.noserver, runWebserver: !options.noserver,