Skip to content

Commit

Permalink
fix: empty itemgroups are not cleaned-up
Browse files Browse the repository at this point in the history
  • Loading branch information
iadonkey committed Aug 27, 2024
1 parent e434549 commit 372bd62
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions TwinpackCore/Core/AutomationInterfaceHeadless.cs
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,9 @@ public override async Task RemoveAllPackagesAsync(string projectName, string plc
while ((element = project.Elements(TcNs + "ItemGroup")?.Where(x => x.Elements(TcNs + "LibraryReference")?.Any() == true)?.FirstOrDefault()) != null)
element.Remove();

while ((element = project.Elements(TcNs + "ItemGroup")?.Where(e => !e.HasElements).FirstOrDefault()) != null)
element.Remove();

xdoc.Save(plcConfig.FilePath);
}

Expand Down

0 comments on commit 372bd62

Please sign in to comment.