From d904812f219c0fa82837b66b18271e5f34e4fe32 Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Mon, 30 Nov 2015 16:03:56 +0100 Subject: Fix relative path detection --- cli/actions.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/actions.js b/cli/actions.js index 25643da..70803b2 100644 --- a/cli/actions.js +++ b/cli/actions.js @@ -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); -- cgit v1.2.3