Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/D2L.Bmx/Aws/AwsCacheModel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
namespace D2L.Bmx.Aws;

internal record AwsCacheModel(
string Org,
string User,
Expand Down
13 changes: 8 additions & 5 deletions src/D2L.Bmx/MessageWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ private readonly bool _noColor
void IMessageWriter.WriteParameter( string description, string value, ParameterSource source ) {
string valueColor = _noColor ? "default" : "cyan2";
string sourceColor = _noColor ? "default" : "grey";
_ansiConsole.MarkupLine( $"[default]{description}:[/] [{valueColor}]{value}[/] [{sourceColor}](from {source})[/]" );
string message = $"[default]{Markup.Escape( description )}:[/] "
+ $"[{valueColor}]{Markup.Escape( value )}[/] "
+ $"[{sourceColor}](from {Markup.Escape( source.ToString() )})[/]";
_ansiConsole.MarkupLine( message );
}

void IMessageWriter.WriteUpdateMessage( string text ) {
Expand All @@ -42,20 +45,20 @@ void IMessageWriter.WriteUpdateMessage( string text ) {
string color = _noColor ? "default" : "black on white";
foreach( string line in lines ) {
string paddedLine = line.PadRight( maxLineLength );
_ansiConsole.MarkupLine( $"[{color}]{paddedLine}[/]" );
_ansiConsole.MarkupLine( $"[{color}]{Markup.Escape( paddedLine )}[/]" );
}
Console.Error.WriteLine();
}

void IMessageWriter.WriteWarning( string text ) {
string color = _noColor ? "default" : "yellow";
_ansiConsole.MarkupLine( $"[{color}]{text}[/]" );
_ansiConsole.MarkupLine( $"[{color}]{Markup.Escape( text )}[/]" );
WriteToFile( $"[WARNING] {text}" );
}

void IMessageWriter.WriteError( string text ) {
string color = _noColor ? "default" : "red";
_ansiConsole.MarkupLine( $"[{color}]{text}[/]" );
_ansiConsole.MarkupLine( $"[{color}]{Markup.Escape( text )}[/]" );
WriteToFile( $"[ERROR] {text}" );
}

Expand Down Expand Up @@ -83,7 +86,7 @@ private void WriteToFile( string text ) {
writer.Flush();
} catch( Exception ex ) {
string color = _noColor ? "default" : "red";
_ansiConsole.MarkupLine( $"[{color}] Error writing to log file: {ex.Message}[/]" );
_ansiConsole.MarkupLine( $"[{color}] Error writing to log file: {Markup.Escape( ex.Message )}[/]" );
}
}
}
1 change: 1 addition & 0 deletions src/D2L.Bmx/Okta/Models/OktaSessionCache.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
namespace D2L.Bmx.Okta.Models;

internal record OktaSessionCache(
string UserId,
string Org,
Expand Down
Loading