Trim console lines.

This commit is contained in:
Jared 2021-04-13 20:04:34 -07:00 committed by Jared Goodwin
parent 80e7f72ea8
commit b25a266522
2 changed files with 7 additions and 3 deletions

View File

@ -95,6 +95,4 @@ systemctl restart remotely.service
# Restart caddy
systemctl restart caddy
echo "Installation completed."
systemctl restart caddy

View File

@ -31,12 +31,18 @@ namespace Remotely.Shared.Utilities
for (var i = 0; i < message.Length;)
{
var lineCount = 0;
var trimLine = i > 0;
var line = new string(message.Skip(i).TakeWhile(x => {
i++;
return lineCount++ < 50 || !char.IsWhiteSpace(x);
}).ToArray());
if (trimLine)
{
line = line.Trim();
}
Console.WriteLine(line);
}
Console.ForegroundColor = ConsoleColor.Gray;