Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit d43a05d

Browse files
committed
fix: always use files.cat
1 parent 4e61958 commit d43a05d

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"detect-node": "^2.0.3",
6969
"glob": "^7.0.6",
7070
"hapi": "^15.0.3",
71-
"ipfs-api": "^8.0.3",
71+
"ipfs-api": "^8.0.4",
7272
"ipfs-bitswap": "^0.7.0",
7373
"ipfs-block": "^0.3.0",
7474
"ipfs-block-service": "^0.5.0",
@@ -132,4 +132,4 @@
132132
"nginnever <[email protected]>",
133133
"npmcdn-to-unpkg-bot <[email protected]>"
134134
]
135-
}
135+
}

src/cli/commands/files/add.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,17 @@ module.exports = {
5555
const index = inPath.lastIndexOf('/') + 1
5656

5757
utils.getIPFS((err, ipfs) => {
58-
if (err) throw err
58+
if (err) {
59+
throw err
60+
}
5961

6062
glob(path.join(inPath, '/**/*'), (err, list) => {
61-
if (err) throw err
62-
if (list.length === 0) list = [inPath]
63+
if (err) {
64+
throw err
65+
}
66+
if (list.length === 0) {
67+
list = [inPath]
68+
}
6369

6470
pull(
6571
zip(

src/cli/commands/files/cat.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,14 @@ module.exports = {
1919
throw err
2020
}
2121

22-
if (utils.isDaemonOn()) {
23-
return ipfs.cat(path, onFile)
24-
}
25-
2622
ipfs.files.cat(path, onFile)
2723
})
2824
}
2925
}
3026

3127
function onFile (err, file) {
3228
if (err) {
29+
console.log(err)
3330
throw (err)
3431
}
3532
file.pipe(process.stdout)

test/cli/test-files.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const HttpAPI = require('../../src/http-api')
77
const repoPath = require('./index').repoPath
88
const _ = require('lodash')
99

10-
describe('files', () => {
10+
describe.only('files', () => {
1111
const env = _.clone(process.env)
1212
env.IPFS_PATH = repoPath
1313

0 commit comments

Comments
 (0)