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

Commit eade807

Browse files
committed
Rename unixfs output from 'stream' to 'content'.
1 parent 94f720c commit eade807

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

src/cli/commands/files/add.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ module.exports = Command.extend({
7373
if (!fs.statSync(element).isDirectory()) {
7474
i.write({
7575
path: element.substring(index + 1, element.length),
76-
stream: fs.createReadStream(element)
76+
content: fs.createReadStream(element)
7777
})
7878
}
7979
callback()
@@ -86,7 +86,7 @@ module.exports = Command.extend({
8686
} else {
8787
rs = fs.createReadStream(inPath)
8888
inPath = inPath.substring(inPath.lastIndexOf('/') + 1, inPath.length)
89-
filePair = {path: inPath, stream: rs}
89+
filePair = {path: inPath, content: rs}
9090
i.write(filePair)
9191
i.end()
9292
}

src/cli/commands/files/cat.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ module.exports = Command.extend({
3636
throw (err)
3737
}
3838
res.on('data', (data) => {
39-
data.stream.pipe(process.stdout)
39+
data.content.pipe(process.stdout)
4040
})
4141
})
4242
})

src/cli/commands/files/get.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function fileHandler (result, dir) {
4848
const dirPath = path.join(dir, file.path)
4949
// Check to see if the result is a directory
5050
if (file.dir === false) {
51-
file.stream.pipe(fs.createWriteStream(dirPath))
51+
file.content.pipe(fs.createWriteStream(dirPath))
5252
} else {
5353
ensureDir(dirPath, (err) => {
5454
if (err) {
@@ -64,7 +64,7 @@ function fileHandler (result, dir) {
6464
throw err
6565
}
6666

67-
file.stream.pipe(fs.createWriteStream(dirPath))
67+
file.content.pipe(fs.createWriteStream(dirPath))
6868
})
6969
}
7070
}

src/core/ipfs/init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ module.exports = function init (self) {
9191
const rs = new Readable()
9292
rs.push(fs.readFileSync(element))
9393
rs.push(null)
94-
const filePair = {path: addPath, stream: rs}
94+
const filePair = {path: addPath, content: rs}
9595
i.write(filePair)
9696
}
9797
callback()

src/http-api/resources/files.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ exports.cat = {
4343
}).code(500)
4444
}
4545
stream.on('data', (data) => {
46-
return reply(data.stream)
46+
return reply(data.content)
4747
})
4848
})
4949
}

test/core-tests/test-bitswap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ describe('bitswap', () => {
165165
ipfs.files.cat(hash, (err, res) => {
166166
expect(err).to.not.exist
167167
res.on('file', (data) => {
168-
data.stream.pipe(bl((err, bldata) => {
168+
data.content.pipe(bl((err, bldata) => {
169169
expect(err).to.not.exist
170170
expect(bldata.toString()).to.equal('I love IPFS <3')
171171
cb()

0 commit comments

Comments
 (0)