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

Export-TodoTxt does not always write to new line in script #23

Open
bubonicfred opened this issue Jan 12, 2021 · 2 comments
Open

Export-TodoTxt does not always write to new line in script #23

bubonicfred opened this issue Jan 12, 2021 · 2 comments
Assignees
Labels

Comments

@bubonicfred
Copy link

bubonicfred commented Jan 12, 2021

I have a script that checks a particular file for todos, sometimes (I believe when the first item in this is on line 1) Export-TodoTxt does not write to a new line. I realise I can fix this in my own script, but have opted to attempt to fix it in PsTodoTxt, using `n to insert newline, and the -NoNewLine parameter to clear any new line the AddContent cmdlet seems to put in by itself.
The below seems to work, but I am by no means great at powershell so would like a more experienced opinion.
"`n$Todo" | ConvertFrom-TodoTxt | Add-Content -Path $Path -Encoding UTF8 -NoNewLine
I have no idea if that's the best approach, but IMO the Export-TodoTxt should be sanitising the input for newlines.

@pauby
Copy link
Owner

pauby commented Jan 12, 2021

@bubonicfred Thanks for reporting this.

Can I ask you to give me some examples (code / todo) so I'm clear on it and can reproduce this? I think I understand what you mean. Just want to be clear.

@pauby pauby self-assigned this Jan 12, 2021
@stale
Copy link

stale bot commented Jun 26, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Invalid label Jun 26, 2021
@pauby pauby added pinned and removed Invalid labels Jun 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants