Commit 4eee848b by Johannes Zellner

Exit if username or password is empty

1 parent ff4aca50
Showing with 2 additions and 0 deletions
...@@ -66,6 +66,8 @@ function login(uri, options) { ...@@ -66,6 +66,8 @@ function login(uri, options) {
var username = options.username || readlineSync.question('Username: '); var username = options.username || readlineSync.question('Username: ');
var password = options.password || readlineSync.question('Password: ', { hideEchoBack: true, mask: '' }); var password = options.password || readlineSync.question('Password: ', { hideEchoBack: true, mask: '' });
if (!username || !password) process.exit(1);
superagent.post(server + '/api/login').send({ username: username, password: password }).end(function (error, result) { superagent.post(server + '/api/login').send({ username: username, password: password }).end(function (error, result) {
if (error && error.code === 'ENOTFOUND') { if (error && error.code === 'ENOTFOUND') {
console.log('Server %s not found.'.red, server.bold); console.log('Server %s not found.'.red, server.bold);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!