From 656900448b4690abca24c204dc3861df4b2e8f5a Mon Sep 17 00:00:00 2001 From: Mattias Erming Date: Wed, 1 Oct 2014 12:05:07 -0700 Subject: [PATCH] Prevent private mode when no user exists --- src/command-line/start.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/command-line/start.js b/src/command-line/start.js index f936a273..dd8425a4 100644 --- a/src/command-line/start.js +++ b/src/command-line/start.js @@ -13,7 +13,13 @@ program .description("Start the server") .action(function() { var users = new ClientManager().getUsers(); - if (!config.public && !users.length) { + var mode = config.public; + if (program.public) { + mode = true; + } else if (program.private) { + mode = false; + } + if (!mode && !users.length) { console.log(""); console.log("No users found!"); console.log("Create a new user with 'shout add '."); @@ -21,12 +27,6 @@ program } else { var host = program.host || process.env.IP || config.host; var port = program.port || process.env.PORT || config.port; - var mode = config.public; - if (program.public) { - mode = true; - } else if (program.private) { - mode = false; - } shout(port, host, mode); } });