Skip to content

Commit 4984c9e

Browse files
authored
Ensure .gitignore update message for devcert.pfx is shown (#231)
Fixes #230
1 parent 8b60f4b commit 4984c9e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,7 @@ await taskContext.AddSubTaskAsync("Generating development certificate", async (t
493493
}
494494
}
495495

496+
bool showedGitignoreMessage = false;
496497
if (!options.RequireExistingConfig && options.SdkInstallMode != SdkInstallMode.None && !options.NoGitignore && localWinappDir?.Parent != null)
497498
{
498499
var gitignorePath = Path.Combine(localWinappDir.Parent.FullName, ".gitignore");
@@ -501,6 +502,7 @@ await taskContext.AddSubTaskAsync("Generating development certificate", async (t
501502
{
502503
await taskContext.AddSubTaskAsync("Updating .gitignore", async (taskContext, cancellationToken) =>
503504
{
505+
showedGitignoreMessage = true;
504506
// Update .gitignore to exclude .winapp folder (unless --no-gitignore is specified)
505507
var addedWinAppToGitIgnore = await gitignoreService.AddWinAppFolderToGitIgnoreAsync(localWinappDir.Parent, taskContext, cancellationToken);
506508

@@ -522,6 +524,14 @@ await taskContext.AddSubTaskAsync("Updating .gitignore", async (taskContext, can
522524
}
523525
}
524526

527+
if (!showedGitignoreMessage && addedCertToGitignore)
528+
{
529+
await taskContext.AddSubTaskAsync("Updating .gitignore", (taskContext, cancellationToken) =>
530+
{
531+
return Task.FromResult((0, "Added devcert.pfx to [underline].gitignore[/]"));
532+
}, cancellationToken);
533+
}
534+
525535
// Update Directory.Packages.props versions to match winapp.yaml if needed (only with SDK installation)
526536
if (options.SdkInstallMode != SdkInstallMode.None && config != null && directoryPackagesService.Exists(options.ConfigDir))
527537
{

0 commit comments

Comments
 (0)