From 4efdf94daa166f522463a00cd61cfc81765f573e Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 14 Aug 2017 15:48:59 +0300 Subject: [PATCH] fix(cloudcmd) empty string in CLOUDCMD_NAME and CLOUDCMD_ROOT --- bin/cloudcmd.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/cloudcmd.js b/bin/cloudcmd.js index e413a5c9..7284d2a7 100755 --- a/bin/cloudcmd.js +++ b/bin/cloudcmd.js @@ -10,7 +10,7 @@ const config = require(DIR_SERVER + 'config'); const env = require(DIR_SERVER + 'env'); const choose = (a, b) => { - if (!a && typeof a !== 'boolean') + if (!a && typeof a === 'undefined') return b; return a; @@ -48,7 +48,7 @@ const args = require('minimist')(argv.slice(2), { ], default: { server : true, - name : env('name') || config('name'), + name : choose(env('name'), config('name')), auth : choose(env('auth'), config('auth')), port : config('port'), online : config('online'), @@ -57,7 +57,7 @@ const args = require('minimist')(argv.slice(2), { packer : config('packer') || 'tar', zip : config('zip'), username : env('username') || config('username'), - root : env('root') || config('root'), + root : choose(env('root'), config('root')), prefix : config('prefix'), progress : config('progress'), console : choose(env.bool('console'), config('console')),