Prevent private mode when no user exists

This commit is contained in:
Mattias Erming 2014-10-01 12:05:07 -07:00
parent cb4b6786b2
commit 656900448b
1 changed files with 7 additions and 7 deletions

View File

@ -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 <name>'.");
@ -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);
}
});