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

Commit

Permalink
chore: do not add newlines to object data
Browse files Browse the repository at this point in the history
  • Loading branch information
achingbrain committed May 14, 2018
1 parent 3820be0 commit 718ba9b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/cli/commands/object/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = {
throw err
}

print(data.toString())
print(data.toString(), false)
})
}
}
7 changes: 7 additions & 0 deletions test/cli/object.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ describe('object', () => runOnAndOff((thing) => {
})
})

it('data with no newline', () => {
return ipfs('object put test/fixtures/test-data/no-newline.json')
.then((out) => expect(out).to.eql('added QmbBiaMqFHy2jNDxHSbwAgx6vWdP5cCYYQanzgT2x4jbCd\n'))
.then(() => ipfs('object data QmbBiaMqFHy2jNDxHSbwAgx6vWdP5cCYYQanzgT2x4jbCd'))
.then(out => expect(out).to.eql('another'))
})

it('links', () => {
return ipfs('object links QmZZmY4KCu9r3e7M2Pcn46Fc5qbn6NpzaAGaYb22kbfTqm').then((out) => {
expect(out).to.eql(
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/test-data/no-newline.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "Data": "another", "Links": [] }

0 comments on commit 718ba9b

Please sign in to comment.