]> git.immae.eu Git - perso/Immae/Projets/Nodejs/Surfer.git/blobdiff - cli/actions.js
Do not show * for password entry
[perso/Immae/Projets/Nodejs/Surfer.git] / cli / actions.js
index 69ffa10329e225d7592791468e9c51e284369b13..a862b4ba90cf11e71596f37b0ce0693370cfece6 100644 (file)
@@ -63,7 +63,7 @@ function login(uri) {
     console.log('Using server', server.cyan);
 
     var username = readlineSync.question('Username: ');
-    var password = readlineSync.question('Password: ', { noEchoBack: true });
+    var password = readlineSync.question('Password: ', { hideEchoBack: true, mask: '' });
 
     superagent.get(server + API + '/').query({ username: username, password: password }).end(function (error, result) {
         if (error && error.code === 'ENOTFOUND') {
@@ -118,7 +118,7 @@ function put(filePath, otherFilePaths, options) {
         var destinationPath = (destination ? '/' + destination : '') + '/' + relativeFilePath;
         console.log('Uploading file %s -> %s', relativeFilePath.cyan, destinationPath.cyan);
 
-        superagent.put(config.server() + API + destinationPath).query(gQuery).attach('file', file).end(function (error, result) {
+        superagent.post(config.server() + API + destinationPath).query(gQuery).attach('file', file).end(function (error, result) {
             if (result && result.statusCode === 403) return callback(new Error('Upload destination ' + destinationPath + ' not allowed'));
             if (result && result.statusCode !== 201) return callback(new Error('Error uploading file: ' + result.statusCode));
             if (error) return callback(error);