pauby / PsTodoTxt

This is a PowerShell CLI to the Todo.txt todo file format with some PowerShell like features.
MIT License
3 stars 3 forks source link

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

Open bubonicfred opened 3 years ago

bubonicfred commented 3 years ago

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 commented 3 years ago

@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.

stale[bot] commented 3 years ago

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.