Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

Commit

Permalink
fix: ls files sizes for compat with go-ipfs 0.4.19 (#449)
Browse files Browse the repository at this point in the history
* fix: ls files sizes for compat with go-ipfs 0.4.19

Adjusts file sizes accordingly.

refs #427

License: MIT
Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>

* fix: end test after stream is complete

License: MIT
Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
  • Loading branch information
alanshaw committed Mar 13, 2019
1 parent d3ad40b commit 2ef1480
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 19 deletions.
3 changes: 2 additions & 1 deletion src/files-regular/add-readable-stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,11 @@ module.exports = (createCommon, options) => {
stream.on('data', (file) => {
if (file.path === 'test-folder') {
expect(file.hash).to.equal(fixtures.directory.cid)
done()
}
})

stream.on('end', done)

files.forEach((file) => stream.write(file))
stream.end()
})
Expand Down
12 changes: 6 additions & 6 deletions src/files-regular/ls-pull-stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,37 +70,37 @@ module.exports = (createCommon, options) => {
{ depth: 1,
name: 'alice.txt',
path: 'QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP/alice.txt',
size: 11696,
size: 11685,
hash: 'QmZyUEQVuRK3XV7L9Dk26pg6RVSgaYkiSTEdnT2kZZdwoi',
type: 'file' },
{ depth: 1,
name: 'empty-folder',
path: 'QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP/empty-folder',
size: 4,
size: 0,
hash: 'QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn',
type: 'dir' },
{ depth: 1,
name: 'files',
path: 'QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP/files',
size: 183,
size: 0,
hash: 'QmZ25UfTqXGz9RsEJFg7HUAuBcmfx5dQZDXQd2QEZ8Kj74',
type: 'dir' },
{ depth: 1,
name: 'holmes.txt',
path: 'QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP/holmes.txt',
size: 582072,
size: 581878,
hash: 'QmR4nFjTu18TyANgC65ArNWp5Yaab1gPzQ4D8zp7Kx3vhr',
type: 'file' },
{ depth: 1,
name: 'jungle.txt',
path: 'QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP/jungle.txt',
size: 2305,
size: 2294,
hash: 'QmT6orWioMiSqXXPGsUi71CKRRUmJ8YkuueV2DPV34E9y9',
type: 'file' },
{ depth: 1,
name: 'pp.txt',
path: 'QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP/pp.txt',
size: 4551,
size: 4540,
hash: 'QmVwdDCY4SPGVFnNCiZnX5CtzwWDn6kAM98JXzKxE3kCmn',
type: 'file' }
])
Expand Down
12 changes: 6 additions & 6 deletions src/files-regular/ls-readable-stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,37 +66,37 @@ module.exports = (createCommon, options) => {
{ depth: 1,
name: 'alice.txt',
path: 'QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP/alice.txt',
size: 11696,
size: 11685,
hash: 'QmZyUEQVuRK3XV7L9Dk26pg6RVSgaYkiSTEdnT2kZZdwoi',
type: 'file' },
{ depth: 1,
name: 'empty-folder',
path: 'QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP/empty-folder',
size: 4,
size: 0,
hash: 'QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn',
type: 'dir' },
{ depth: 1,
name: 'files',
path: 'QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP/files',
size: 183,
size: 0,
hash: 'QmZ25UfTqXGz9RsEJFg7HUAuBcmfx5dQZDXQd2QEZ8Kj74',
type: 'dir' },
{ depth: 1,
name: 'holmes.txt',
path: 'QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP/holmes.txt',
size: 582072,
size: 581878,
hash: 'QmR4nFjTu18TyANgC65ArNWp5Yaab1gPzQ4D8zp7Kx3vhr',
type: 'file' },
{ depth: 1,
name: 'jungle.txt',
path: 'QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP/jungle.txt',
size: 2305,
size: 2294,
hash: 'QmT6orWioMiSqXXPGsUi71CKRRUmJ8YkuueV2DPV34E9y9',
type: 'file' },
{ depth: 1,
name: 'pp.txt',
path: 'QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP/pp.txt',
size: 4551,
size: 4540,
hash: 'QmVwdDCY4SPGVFnNCiZnX5CtzwWDn6kAM98JXzKxE3kCmn',
type: 'file' }
])
Expand Down
12 changes: 6 additions & 6 deletions src/files-regular/ls.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,37 +69,37 @@ module.exports = (createCommon, options) => {
{ depth: 1,
name: 'alice.txt',
path: 'QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP/alice.txt',
size: 11696,
size: 11685,
hash: 'QmZyUEQVuRK3XV7L9Dk26pg6RVSgaYkiSTEdnT2kZZdwoi',
type: 'file' },
{ depth: 1,
name: 'empty-folder',
path: 'QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP/empty-folder',
size: 4,
size: 0,
hash: 'QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn',
type: 'dir' },
{ depth: 1,
name: 'files',
path: 'QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP/files',
size: 183,
size: 0,
hash: 'QmZ25UfTqXGz9RsEJFg7HUAuBcmfx5dQZDXQd2QEZ8Kj74',
type: 'dir' },
{ depth: 1,
name: 'holmes.txt',
path: 'QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP/holmes.txt',
size: 582072,
size: 581878,
hash: 'QmR4nFjTu18TyANgC65ArNWp5Yaab1gPzQ4D8zp7Kx3vhr',
type: 'file' },
{ depth: 1,
name: 'jungle.txt',
path: 'QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP/jungle.txt',
size: 2305,
size: 2294,
hash: 'QmT6orWioMiSqXXPGsUi71CKRRUmJ8YkuueV2DPV34E9y9',
type: 'file' },
{ depth: 1,
name: 'pp.txt',
path: 'QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP/pp.txt',
size: 4551,
size: 4540,
hash: 'QmVwdDCY4SPGVFnNCiZnX5CtzwWDn6kAM98JXzKxE3kCmn',
type: 'file' }
])
Expand Down

0 comments on commit 2ef1480

Please sign in to comment.