Skip to content

Commit

Permalink
Add newline to end of the output for a few commands.
Browse files Browse the repository at this point in the history
Commands affected:

 - ipfs object put
 - ipfs tar add
 - ipfs resolve
 - ipfs name resolve

License: MIT
Signed-off-by: Nick Hamann <nick@wabbo.org>

More
  • Loading branch information
Nick Hamann committed Nov 29, 2015
1 parent c9d118c commit 8a61b53
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion core/commands/ipns.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ Resolve the value of another name:
if !ok {
return nil, u.ErrCast()
}
return strings.NewReader(output.Path.String()), nil
return strings.NewReader(output.Path.String() + "\n"), nil
},
},
Type: ResolvedPath{},
Expand Down
2 changes: 1 addition & 1 deletion core/commands/object.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ and then run
Marshalers: cmds.MarshalerMap{
cmds.Text: func(res cmds.Response) (io.Reader, error) {
object := res.Output().(*Object)
return strings.NewReader("added " + object.Hash), nil
return strings.NewReader("added " + object.Hash + "\n"), nil
},
},
Type: Object{},
Expand Down
2 changes: 1 addition & 1 deletion core/commands/resolve.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ Resolve the value of an IPFS DAG path:
if !ok {
return nil, u.ErrCast()
}
return strings.NewReader(output.Path.String()), nil
return strings.NewReader(output.Path.String() + "\n"), nil
},
},
Type: ResolvedPath{},
Expand Down
2 changes: 1 addition & 1 deletion core/commands/tar.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ var tarAddCmd = &cmds.Command{
Marshalers: cmds.MarshalerMap{
cmds.Text: func(res cmds.Response) (io.Reader, error) {
o := res.Output().(*AddedObject)
return strings.NewReader(o.Hash), nil
return strings.NewReader(o.Hash + "\n"), nil
},
},
}
Expand Down
12 changes: 6 additions & 6 deletions test/sharness/t0051-object.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ test_object_cmd() {

test_expect_success "'ipfs object put file.json' output looks good" '
HASH="QmUTSAdDi2xsNkDtLqjFgQDMEn5di3Ab9eqbrt4gaiNbUD" &&
printf "added $HASH" > expected_putOut &&
printf "added $HASH\n" > expected_putOut &&
test_cmp expected_putOut actual_putOut
'

Expand All @@ -76,7 +76,7 @@ test_object_cmd() {

test_expect_success "'ipfs object put file.xml' output looks good" '
HASH="QmQzNKUHy4HyEUGkqKe3q3t796ffPLQXYCkHCcXUNT5JNK" &&
printf "added $HASH" > expected_putOut &&
printf "added $HASH\n" > expected_putOut &&
test_cmp expected_putOut actual_putOut
'

Expand All @@ -103,7 +103,7 @@ test_object_cmd() {
'

test_expect_failure "'ipfs object put --inputenc=xml' output looks good" '
echo "added $HASH" >expected &&
echo "added $HASH\n" >expected &&
test_cmp expected actual
'

Expand All @@ -113,7 +113,7 @@ test_object_cmd() {

test_expect_success "'ipfs object put file.pb' output looks good" '
HASH="QmUTSAdDi2xsNkDtLqjFgQDMEn5di3Ab9eqbrt4gaiNbUD" &&
printf "added $HASH" > expected_putOut &&
printf "added $HASH\n" > expected_putOut &&
test_cmp expected_putOut actual_putOut
'

Expand All @@ -123,7 +123,7 @@ test_object_cmd() {

test_expect_success "'ipfs object put' from stdin output looks good" '
HASH="QmUTSAdDi2xsNkDtLqjFgQDMEn5di3Ab9eqbrt4gaiNbUD" &&
printf "added $HASH" > expected_putStdinOut &&
printf "added $HASH\n" > expected_putStdinOut &&
test_cmp expected_putStdinOut actual_putStdinOut
'

Expand All @@ -133,7 +133,7 @@ test_object_cmd() {

test_expect_success "'ipfs object put' from stdin (pb) output looks good" '
HASH="QmUTSAdDi2xsNkDtLqjFgQDMEn5di3Ab9eqbrt4gaiNbUD" &&
printf "added $HASH" > expected_putStdinOut &&
printf "added $HASH\n" > expected_putStdinOut &&
test_cmp expected_putStdinOut actual_putPbStdinOut
'

Expand Down

0 comments on commit 8a61b53

Please sign in to comment.