This repository was archived by the owner on Feb 12, 2024. It is now read-only.
File tree 6 files changed +8
-8
lines changed 6 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ module.exports = Command.extend({
73
73
if ( ! fs . statSync ( element ) . isDirectory ( ) ) {
74
74
i . write ( {
75
75
path : element . substring ( index + 1 , element . length ) ,
76
- stream : fs . createReadStream ( element )
76
+ content : fs . createReadStream ( element )
77
77
} )
78
78
}
79
79
callback ( )
@@ -86,7 +86,7 @@ module.exports = Command.extend({
86
86
} else {
87
87
rs = fs . createReadStream ( inPath )
88
88
inPath = inPath . substring ( inPath . lastIndexOf ( '/' ) + 1 , inPath . length )
89
- filePair = { path : inPath , stream : rs }
89
+ filePair = { path : inPath , content : rs }
90
90
i . write ( filePair )
91
91
i . end ( )
92
92
}
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ module.exports = Command.extend({
36
36
throw ( err )
37
37
}
38
38
res . on ( 'data' , ( data ) => {
39
- data . stream . pipe ( process . stdout )
39
+ data . content . pipe ( process . stdout )
40
40
} )
41
41
} )
42
42
} )
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ function fileHandler (result, dir) {
48
48
const dirPath = path . join ( dir , file . path )
49
49
// Check to see if the result is a directory
50
50
if ( file . dir === false ) {
51
- file . stream . pipe ( fs . createWriteStream ( dirPath ) )
51
+ file . content . pipe ( fs . createWriteStream ( dirPath ) )
52
52
} else {
53
53
ensureDir ( dirPath , ( err ) => {
54
54
if ( err ) {
@@ -64,7 +64,7 @@ function fileHandler (result, dir) {
64
64
throw err
65
65
}
66
66
67
- file . stream . pipe ( fs . createWriteStream ( dirPath ) )
67
+ file . content . pipe ( fs . createWriteStream ( dirPath ) )
68
68
} )
69
69
}
70
70
}
Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ module.exports = function init (self) {
91
91
const rs = new Readable ( )
92
92
rs . push ( fs . readFileSync ( element ) )
93
93
rs . push ( null )
94
- const filePair = { path : addPath , stream : rs }
94
+ const filePair = { path : addPath , content : rs }
95
95
i . write ( filePair )
96
96
}
97
97
callback ( )
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ exports.cat = {
43
43
} ) . code ( 500 )
44
44
}
45
45
stream . on ( 'data' , ( data ) => {
46
- return reply ( data . stream )
46
+ return reply ( data . content )
47
47
} )
48
48
} )
49
49
}
Original file line number Diff line number Diff line change @@ -165,7 +165,7 @@ describe('bitswap', () => {
165
165
ipfs . files . cat ( hash , ( err , res ) => {
166
166
expect ( err ) . to . not . exist
167
167
res . on ( 'file' , ( data ) => {
168
- data . stream . pipe ( bl ( ( err , bldata ) => {
168
+ data . content . pipe ( bl ( ( err , bldata ) => {
169
169
expect ( err ) . to . not . exist
170
170
expect ( bldata . toString ( ) ) . to . equal ( 'I love IPFS <3' )
171
171
cb ( )
You can’t perform that action at this time.
0 commit comments