]> git.immae.eu Git - perso/Immae/Projets/Nodejs/Surfer.git/commitdiff
Exit if username or password is empty
authorJohannes Zellner <johannes@cloudron.io>
Thu, 9 Feb 2017 14:48:08 +0000 (15:48 +0100)
committerJohannes Zellner <johannes@cloudron.io>
Thu, 9 Feb 2017 14:48:08 +0000 (15:48 +0100)
cli/actions.js

index e9bbd9d8ce5f72a2514c3a925693e9bab875d7be..2440c2de6cf5e86119ee948a7687a6bb071da0e3 100644 (file)
@@ -66,6 +66,8 @@ function login(uri, options) {
     var username = options.username || readlineSync.question('Username: ');
     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) {
         if (error && error.code === 'ENOTFOUND') {
             console.log('Server %s not found.'.red, server.bold);