]> git.immae.eu Git - perso/Immae/Projets/Nodejs/Surfer.git/blobdiff - cli/actions.js
Add missing callback in upload
[perso/Immae/Projets/Nodejs/Surfer.git] / cli / actions.js
index 25643da705a0070153af8ec6bff6f3f44f88a432..ab982a7a14418d6ea977ae5f84d1ddba6b6ec889 100644 (file)
@@ -97,9 +97,10 @@ function put(filePath, otherFilePaths, options) {
 
     async.eachSeries(files, function (file, callback) {
         var relativeFilePath;
+
         if (path.isAbsolute(file)) {
             relativeFilePath = path.basename(file);
-        } else if (path.resolve(file).indexOf(process.cwd().length) === 0) { // relative to current dir
+        } else if (path.resolve(file).indexOf(process.cwd()) === 0) { // relative to current dir
             relativeFilePath = path.resolve(file).slice(process.cwd().length + 1);
         } else { // relative but somewhere else
             relativeFilePath = path.basename(file);
@@ -113,6 +114,8 @@ function put(filePath, otherFilePaths, options) {
             if (result.statusCode !== 201) return callback(new Error('Error uploading file: ' + result.statusCode));
 
             console.log('Uploaded to ' + config.server() + destinationPath);
+
+            callback(null);
         });
     }, function (error) {
         if (error) {