From 1b98fa16c85c5e43cb2bd14995e5d2571204367f Mon Sep 17 00:00:00 2001 From: Richard Schneider Date: Wed, 20 Dec 2017 21:07:26 +1300 Subject: [PATCH] fix: cli files on Windows (#1159) * fix: files add -w * fix: files get --- src/cli/commands/files/add.js | 2 +- src/cli/commands/files/get.js | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/cli/commands/files/add.js b/src/cli/commands/files/add.js index a41822b8db..5886ac2365 100644 --- a/src/cli/commands/files/add.js +++ b/src/cli/commands/files/add.js @@ -81,7 +81,7 @@ function addPipeline (index, addStream, list, argv) { originalPath: file.path })), pull.map((file) => ({ - path: wrapWithDirectory ? path.join(WRAPPER, file.path) : file.path, + path: wrapWithDirectory ? WRAPPER + file.path : file.path, content: fs.createReadStream(file.originalPath) })), addStream, diff --git a/src/cli/commands/files/get.js b/src/cli/commands/files/get.js index 5c3a82563e..85ee810671 100644 --- a/src/cli/commands/files/get.js +++ b/src/cli/commands/files/get.js @@ -9,12 +9,8 @@ const print = require('../../utils').print function checkArgs (hash, outPath) { // format the output directory - if (!outPath.endsWith('/')) { - outPath += '/' - } - - if (!outPath.startsWith('/')) { - outPath = path.join('/', outPath) + if (!outPath.endsWith(path.sep)) { + outPath += path.sep } return outPath