Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Echo doesn't return value ending in a trailing newline #476

Closed
gvn opened this issue Jul 22, 2016 · 5 comments
Closed

Echo doesn't return value ending in a trailing newline #476

gvn opened this issue Jul 22, 2016 · 5 comments
Assignees
Labels
breaking Breaking change fix Bug/defect, or a fix for such a problem help wanted
Milestone

Comments

@gvn
Copy link

gvn commented Jul 22, 2016

Node version:

v6.2.0

ShellJS version (the most recent version/Github branch you see the bug on):

0.7.0

Operating system:

OSX 10.11.5

Description of the bug:

Using toEnd doesn't prepend a newline when chained to echo.

Example ShellJS command to reproduce the error:

shell.echo(`A`).toEnd(`test.txt`);
shell.echo(`B`).toEnd(`test.txt`);

test.txt becomes: AB

echo A >> test.txt
echo B >> test.txt

test.txt becomes:

A
B
@nfischer nfischer added the fix Bug/defect, or a fix for such a problem label Jul 22, 2016
@nfischer nfischer added this to the v0.8.0 milestone Jul 22, 2016
@nfischer
Copy link
Member

This has to do with the behavior of echo(), not toEnd. This is still a valid point, but to fix it would involve breaking the behavior of echo(), so it would have to wait for v0.8.

@gvn The fix is pretty trivial, it just involves appending a newline to the value returned by echo(), if you'd like to fix it yourself 😄

@nfischer nfischer changed the title echo + toEnd doesn't function like UNIX equivalent Echo doesn't return value ending in a trailing newline Jul 25, 2016
@gvn
Copy link
Author

gvn commented Aug 20, 2016

Ok cool. Yeah, would be good to fix, but I can add a newline manually for now. Thanks!

@nfischer
Copy link
Member

@freitagbr do you want to take a look at this?

@freitagbr
Copy link
Contributor

Sure, I'll take a look.

@nfischer nfischer added the breaking Breaking change label Feb 3, 2017
@nfischer
Copy link
Member

nfischer commented Jun 7, 2017

This is now fixed on trunk in #557

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Breaking change fix Bug/defect, or a fix for such a problem help wanted
Projects
None yet
Development

No branches or pull requests

3 participants