aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--cli/actions.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/cli/actions.js b/cli/actions.js
index 6fb9893..735b631 100644
--- a/cli/actions.js
+++ b/cli/actions.js
@@ -93,7 +93,15 @@ function put(filePath, otherFilePaths, options) {
93 var files = collectFiles([ filePath ].concat(otherFilePaths)); 93 var files = collectFiles([ filePath ].concat(otherFilePaths));
94 94
95 async.eachSeries(files, function (file, callback) { 95 async.eachSeries(files, function (file, callback) {
96 var relativeFilePath = path.resolve(file).slice(process.cwd().length + 1); 96 var relativeFilePath;
97 if (path.isAbsolute(file)) {
98 relativeFilePath = path.basename(file);
99 } else if (path.resolve(file).indexOf(process.cwd().length) === 0) { // relative to current dir
100 relativeFilePath = path.resolve(file).slice(process.cwd().length + 1);
101 } else { // relative but somewhere else
102 relativeFilePath = path.basename(file);
103 }
104
97 var destinationPath = (options.destination ? '/' + options.destination : '') + '/' + relativeFilePath; 105 var destinationPath = (options.destination ? '/' + options.destination : '') + '/' + relativeFilePath;
98 console.log('Uploading file %s -> %s', relativeFilePath.cyan, destinationPath.cyan); 106 console.log('Uploading file %s -> %s', relativeFilePath.cyan, destinationPath.cyan);
99 107