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

Commit c7df77e

Browse files
fix(cli): pipe content to the cli from cat it is a stream
1 parent ebc93de commit c7df77e

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/cli/commands/files/cat.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@ module.exports = {
2323
if (err) {
2424
throw err
2525
}
26-
console.log(res.toString())
26+
27+
res.pipe(process.stdout)
2728
})
2829
return
2930
}
31+
3032
ipfs.files.cat(path, (err, file) => {
3133
if (err) {
3234
throw (err)

test/cli/test-files.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ describe('files', () => {
8080
.run((err, stdout, exitcode) => {
8181
expect(err).to.not.exist
8282
expect(exitcode).to.equal(0)
83+
expect(stdout[0]).to.equal('hello world')
8384
done()
8485
})
8586
})

0 commit comments

Comments
 (0)