Clarify some users.length that were forgotten in a previous PR

This commit is contained in:
Jérémie Astori 2017-08-26 00:55:49 -04:00
parent 252dca3d3f
commit 234fd31411
No known key found for this signature in database
GPG Key ID: B9A4F245CD67BDE8
2 changed files with 8 additions and 8 deletions

View File

@ -41,7 +41,7 @@ ClientManager.prototype.autoloadUsers = function() {
process.exit(1);
}
if (!users.length) {
if (users.length === 0) {
log.info(noUsersWarning);
}
@ -51,7 +51,7 @@ ClientManager.prototype.autoloadUsers = function() {
const loaded = this.clients.map((c) => c.name);
const updatedUsers = this.getUsers();
if (!updatedUsers.length) {
if (updatedUsers.length === 0) {
log.info(noUsersWarning);
}

View File

@ -28,12 +28,12 @@ program
return;
}
if (!users.length) {
log.info(`There are currently no users. Create one with ${colors.bold("lounge add <name>")}.`);
} else {
if (users.length > 0) {
log.info("Users:");
for (var i = 0; i < users.length; i++) {
log.info(`${i + 1}. ${colors.bold(users[i])}`);
}
users.forEach((user, i) => {
log.info(`${i + 1}. ${colors.bold(user)}`);
});
} else {
log.info(`There are currently no users. Create one with ${colors.bold("lounge add <name>")}.`);
}
});