Skip to content

Commit bff7f5a

Browse files
authored
Fix indentation. (#250)
## Description Improves indentation for output messages with emojis that are not monospace. ## Related Issue Fixes #244. ## Type of Change <!-- Mark the appropriate option(s) with an "x" --> - [X] 🐛 Bug fix (non-breaking change that fixes an issue) - [ ] ✨ New feature (non-breaking change that adds functionality) - [ ] 💥 Breaking change (fix or feature that would cause existing functionality to change) - [ ] 📝 Documentation update - [ ] 🔧 Configuration/build change - [ ] ♻️ Refactoring (no functional changes) - [ ] 🧪 Test update ## Checklist ### Build & Tests - [X] All CI builds pass (Build and Package workflow) - [X] All existing tests pass - [ ] New tests added for new functionality (if applicable) - [X] Tested locally on Windows ### README & Guides <!-- Check all that apply to your changes --> - [ ] Main [README.md](../README.md) updated (if applicable) - [ ] [docs/usage.md](../docs/usage.md) updated (if CLI commands changed) - [ ] [Language-specific guides](../docs/guides) updated (if applicable) - [ ] [Sample projects updated](../samples) to reflect changes (if applicable) - [X] No documentation updates needed ## Screenshots / Demo <!-- If applicable, add screenshots or GIFs demonstrating the changes --> ## Additional Notes <!-- Any additional information that reviewers should know -->
1 parent 3d19f2a commit bff7f5a

File tree

5 files changed

+9
-10
lines changed

5 files changed

+9
-10
lines changed

src/winapp-CLI/WinApp.Cli/Commands/PackageCommand.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,6 @@ public override async Task<int> InvokeAsync(ParseResult parseResult, Cancellatio
118118

119119
var result = await msixService.CreateMsixPackageAsync(inputFolder, output, taskContext, name, skipPri, autoSign, certPath, certPassword, generateCert, installCert, publisher, manifestPath, selfContained, cancellationToken);
120120

121-
taskContext.AddStatusMessage($"{UiSymbols.Check} MSIX package created successfully!");
122-
123121
taskContext.AddStatusMessage($"{UiSymbols.Package} Package: {result.MsixPath}");
124122
if (result.Signed)
125123
{

src/winapp-CLI/WinApp.Cli/ConsoleTasks/GroupableTask.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,12 @@ static string FormatCheckMarkMessage(string indentStr, string message)
126126
|| char.GetUnicodeCategory(firstChar) == System.Globalization.UnicodeCategory.OtherSymbol
127127
|| firstChar == '[';
128128
}
129-
return firstCharIsEmojiOrOpenBracket ? $"{indentStr} {message}" : $"{indentStr}[green]{Emoji.Known.CheckMarkButton}[/] {message}";
129+
return firstCharIsEmojiOrOpenBracket ? $"{indentStr}{message}" : $"{indentStr}[green]{Emoji.Known.CheckMarkButton}[/] {message}";
130130
}
131131

132132
msg = task switch
133133
{
134-
StatusMessageTask statusMessageTask => $"{indentStr} {Markup.Escape(statusMessageTask.CompletedMessage ?? string.Empty)}",
134+
StatusMessageTask statusMessageTask => $"{indentStr}{Markup.Escape(statusMessageTask.CompletedMessage ?? string.Empty)}",
135135
GroupableTask<T> genericTask => FormatCheckMarkMessage(indentStr, (genericTask.CompletedMessage as ITuple) switch
136136
{
137137
ITuple tuple when tuple.Length > 0 && tuple[0] is string str => str,

src/winapp-CLI/WinApp.Cli/Helpers/UiSymbols.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,13 @@ internal static class UiSymbols
1414
public static string Wrench => Emoji.Known.Wrench;
1515
public static string Package => Emoji.Known.Package;
1616
public static string Bullet => "•";
17-
public static string Skip => Emoji.Known.NextTrackButton;
18-
public static string Tools => Emoji.Known.HammerAndWrench;
17+
public static string Skip => "\U000027A1 ";
18+
public static string Tools => $"{Emoji.Known.HammerAndWrench} ";
1919
public static string Files => Emoji.Known.FileFolder;
2020
public static string Check => Emoji.Known.CheckMarkButton;
2121
public static string Books => Emoji.Known.Books;
2222
public static string Search => Emoji.Known.MagnifyingGlassTiltedRight;
2323
public static string Save => Emoji.Known.FloppyDisk;
24-
public static string Party => Emoji.Known.PartyPopper;
2524
public static string Warning => Emoji.Known.Warning;
2625
public static string Error => Emoji.Known.CrossMark;
2726
public static string Info => Emoji.Known.Information;
@@ -33,5 +32,4 @@ internal static class UiSymbols
3332
public static string Id => Emoji.Known.IdButton;
3433
public static string Clipboard => Emoji.Known.Clipboard;
3534
public static string Verbose => Emoji.Known.MagnifyingGlassTiltedLeft;
36-
public static string Question => Emoji.Known.RedQuestionMark;
3735
}

src/winapp-CLI/WinApp.Cli/Services/ManifestTemplateService.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.Text;
66
using System.Text.RegularExpressions;
77
using WinApp.Cli.ConsoleTasks;
8+
using WinApp.Cli.Helpers;
89
using WinApp.Cli.Models;
910

1011
namespace WinApp.Cli.Services;
@@ -221,7 +222,7 @@ private static async Task GenerateDefaultAssetsAsync(DirectoryInfo outputDirecto
221222
await using var fs = File.Create(target);
222223
await s.CopyToAsync(fs, cancellationToken);
223224

224-
taskContext.AddDebugMessage($" Generated asset: {fileName}");
225+
taskContext.AddDebugMessage($"{UiSymbols.Check} Generated asset: {fileName}");
225226
}
226227
}
227228

src/winapp-CLI/WinApp.Cli/Services/MsixService.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License.
33

4+
using Microsoft.Extensions.Logging;
45
using System.IO.Compression;
56
using System.Security;
67
using System.Text;
@@ -22,6 +23,7 @@ internal partial class MsixService(
2223
IPackageCacheService packageCacheService,
2324
IWorkspaceSetupService workspaceSetupService,
2425
IDevModeService devModeService,
26+
ILogger<MsixService> logger,
2527
ICurrentDirectoryProvider currentDirectoryProvider) : IMsixService
2628
{
2729
[GeneratedRegex(@"PublicFolder\s*=\s*[""']([^""']*)[""']", RegexOptions.IgnoreCase, "en-US")]
@@ -787,7 +789,7 @@ public async Task<CreateMsixPackageResult> CreateMsixPackageAsync(
787789
tempFiles.Add(priConfigFilePath);
788790
var resourceFiles = await GeneratePriFileAsync(inputFolder, taskContext, cancellationToken: cancellationToken);
789791
tempFiles.AddRange(resourceFiles);
790-
if (resourceFiles.Count > 0)
792+
if (resourceFiles.Count > 0 && logger.IsEnabled(LogLevel.Debug))
791793
{
792794
taskContext.AddDebugMessage($"Resource files included in PRI:");
793795
await taskContext.AddSubTaskAsync("Pri Resources", async (taskContext, cancellationToken) =>

0 commit comments

Comments
 (0)