From 5b8da135c0bc7b675bac77bb708c95d699db421c Mon Sep 17 00:00:00 2001 From: David Dias Date: Mon, 12 Sep 2016 19:39:01 -0400 Subject: [PATCH] fix: always use files.cat --- package.json | 4 ++-- src/cli/commands/files/add.js | 12 +++++++++--- src/cli/commands/files/cat.js | 4 ---- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index fc8f27f53f..7355b74bf4 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "detect-node": "^2.0.3", "glob": "^7.0.6", "hapi": "^15.0.3", - "ipfs-api": "^8.0.3", + "ipfs-api": "^8.0.4", "ipfs-bitswap": "^0.7.0", "ipfs-block": "^0.3.0", "ipfs-block-service": "^0.5.0", @@ -132,4 +132,4 @@ "nginnever ", "npmcdn-to-unpkg-bot " ] -} \ No newline at end of file +} diff --git a/src/cli/commands/files/add.js b/src/cli/commands/files/add.js index eb13ac1cb9..047fd34c91 100644 --- a/src/cli/commands/files/add.js +++ b/src/cli/commands/files/add.js @@ -55,11 +55,17 @@ module.exports = { const index = inPath.lastIndexOf('/') + 1 utils.getIPFS((err, ipfs) => { - if (err) throw err + if (err) { + throw err + } glob(path.join(inPath, '/**/*'), (err, list) => { - if (err) throw err - if (list.length === 0) list = [inPath] + if (err) { + throw err + } + if (list.length === 0) { + list = [inPath] + } pull( zip( diff --git a/src/cli/commands/files/cat.js b/src/cli/commands/files/cat.js index a28a22e6e9..7c16b9aa6e 100644 --- a/src/cli/commands/files/cat.js +++ b/src/cli/commands/files/cat.js @@ -19,10 +19,6 @@ module.exports = { throw err } - if (utils.isDaemonOn()) { - return ipfs.cat(path, onFile) - } - ipfs.files.cat(path, onFile) }) }