From 040891fe3caf662c4897eb78d7680c32f7a56072 Mon Sep 17 00:00:00 2001 From: Diogo Silva Date: Mon, 7 Jan 2019 10:05:51 +0000 Subject: [PATCH] fix: add by path (#923) --- src/bundles/files.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bundles/files.js b/src/bundles/files.js index 52f7418f1..ddc403426 100644 --- a/src/bundles/files.js +++ b/src/bundles/files.js @@ -271,7 +271,8 @@ export default (opts = {}) => { doFilesAddPath: make(actions.ADD_BY_PATH, (ipfs, root, src) => { const name = src.split('/').pop() const dst = join(root, name) - return ipfs.files.cp([src, dst]) + const srcPath = src.startsWith('/') ? src : `/ipfs/${name}` + return ipfs.files.cp([srcPath, dst]) }), doFilesDownloadLink: make(actions.DOWNLOAD_LINK, async (ipfs, files, id, { store }) => {