X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=cli%2Factions.js;h=70803b22e7ecb355b60c24f4b79ed18fffacbaad;hb=d904812f219c0fa82837b66b18271e5f34e4fe32;hp=25643da705a0070153af8ec6bff6f3f44f88a432;hpb=d53a1669766a1a77bda34ee52109bee9c8735bda;p=perso%2FImmae%2FProjets%2FNodejs%2FSurfer.git 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);