Skip to content

Commit

Permalink
move color to setting, update signing cert
Browse files Browse the repository at this point in the history
  • Loading branch information
WouterTinus committed Feb 2, 2024
1 parent 12a6c29 commit f2a2cfe
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 6 deletions.
Binary file modified build/codesigning.pfx
Binary file not shown.
3 changes: 2 additions & 1 deletion build/sign-exe.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ New-SelfSignedCertificate `
-CertStoreLocation cert:\currentuser\my `
-Subject "CN=WACS" `
-KeyUsage DigitalSignature `
-Type CodeSigning
-Type CodeSigning `
-NotAfter (Get-Date).AddMonths(24)
#>

param (
Expand Down
12 changes: 12 additions & 0 deletions src/main.lib/Configuration/Settings/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,18 @@ public class UiSettings
/// How console tekst should be encoded
/// </summary>
public string? TextEncoding { get; set; }
/// <summary>
/// Which colors should be applied
/// </summary>
public ColorSettings? Color { get; set; }
}

/// <summary>
/// Colors
/// </summary>
public class ColorSettings
{
public string? Background { get; set; }
}

public class AcmeSettings
Expand Down
9 changes: 5 additions & 4 deletions src/main.lib/Services/InputService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void CreateSpace()
}
}

private static void WriteLine(string? text = "", ConsoleColor? color = null)
private void WriteLine(string? text = "", ConsoleColor? color = null)
{
text ??= "";
var size = -1;
Expand All @@ -66,14 +66,15 @@ private static void WriteLine(string? text = "", ConsoleColor? color = null)

private const string Black = "\u001b[40m";
private const string Reset = "\u001b[0m";
private static void Write(string? text = "", ConsoleColor? color = null)
private void Write(string? text = "", ConsoleColor? color = null)
{
text ??= "";
if (color != null)
{
Console.ForegroundColor = color.Value;
}
if (Environment.OSVersion.Version.Major >= 10)
if (Environment.OSVersion.Version.Major >= 10 &&
_settings.UI?.Color?.Background == "black")
{
text = $"{Black}{text}{Reset}";
}
Expand Down Expand Up @@ -159,7 +160,7 @@ public void Show(string? label, string? value, int level = 0)
_dirty = true;
}

private static void WriteMultiline(int startPos, string value)
private void WriteMultiline(int startPos, string value)
{
var step = 79 - startPos;
var sentences = value.Split('\n');
Expand Down
5 changes: 4 additions & 1 deletion src/main/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
"UI": {
"DateFormat": "yyyy/M/d",
"PageSize": 50,
"TextEncoding": "utf-8"
"TextEncoding": "utf-8",
"Color": {
"Background": null
}
},
"Acme": {
"DefaultBaseUri": "https://acme-v02.api.letsencrypt.org/",
Expand Down

0 comments on commit f2a2cfe

Please sign in to comment.