Skip to content

Commit a404de7

Browse files
committed
Check entry existence before adding
1 parent b3672ad commit a404de7

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/EasySign.CommandLine/BundleWorker.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,18 @@ protected virtual void RunAdd(StatusContext statusContext)
4343
Parallel.ForEach(Utilities.SafeEnumerateFiles(Bundle.RootPath, "*"), file =>
4444
{
4545
if (file == Bundle.BundlePath) return;
46-
Bundle.AddEntry(file);
47-
AnsiConsole.MarkupLine($"[blue]Added:[/] {Path.GetRelativePath(Bundle.RootPath, file)}");
46+
47+
var entryName = Manifest.GetNormalizedEntryName(Path.GetRelativePath(Bundle.RootPath, file));
48+
49+
if (Bundle.Manifest.Entries.ContainsKey(entryName))
50+
{
51+
AnsiConsole.MarkupLine($"[{Color.Orange1}]Exists:[/] {entryName}");
52+
}
53+
else
54+
{
55+
Bundle.AddEntry(file);
56+
AnsiConsole.MarkupLine($"[blue]Added:[/] {entryName}");
57+
}
4858
});
4959

5060
statusContext.Status("[yellow]Saving Bundle[/]");

0 commit comments

Comments
 (0)