diff options
author | Johannes Zellner <johannes@nebulon.de> | 2015-11-30 16:03:56 +0100 |
---|---|---|
committer | Johannes Zellner <johannes@nebulon.de> | 2015-11-30 16:03:56 +0100 |
commit | d904812f219c0fa82837b66b18271e5f34e4fe32 (patch) | |
tree | 1b7d3800055cd26cef3d1491894a89014c46d3d5 /cli | |
parent | d53a1669766a1a77bda34ee52109bee9c8735bda (diff) | |
download | Surfer-d904812f219c0fa82837b66b18271e5f34e4fe32.tar.gz Surfer-d904812f219c0fa82837b66b18271e5f34e4fe32.tar.zst Surfer-d904812f219c0fa82837b66b18271e5f34e4fe32.zip |
Fix relative path detection
Diffstat (limited to 'cli')
-rw-r--r-- | cli/actions.js | 3 |
1 files changed, 2 insertions, 1 deletions
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) { | |||
97 | 97 | ||
98 | async.eachSeries(files, function (file, callback) { | 98 | async.eachSeries(files, function (file, callback) { |
99 | var relativeFilePath; | 99 | var relativeFilePath; |
100 | |||
100 | if (path.isAbsolute(file)) { | 101 | if (path.isAbsolute(file)) { |
101 | relativeFilePath = path.basename(file); | 102 | relativeFilePath = path.basename(file); |
102 | } else if (path.resolve(file).indexOf(process.cwd().length) === 0) { // relative to current dir | 103 | } else if (path.resolve(file).indexOf(process.cwd()) === 0) { // relative to current dir |
103 | relativeFilePath = path.resolve(file).slice(process.cwd().length + 1); | 104 | relativeFilePath = path.resolve(file).slice(process.cwd().length + 1); |
104 | } else { // relative but somewhere else | 105 | } else { // relative but somewhere else |
105 | relativeFilePath = path.basename(file); | 106 | relativeFilePath = path.basename(file); |