Skip to content

Commit

Permalink
groups
Browse files Browse the repository at this point in the history
  • Loading branch information
Maggus85 committed Aug 22, 2024
1 parent 6a19553 commit 019bba1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions DependencyUpdated.Core/Config/Project.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ public sealed class Project : IValidatableObject
public string[] Directories { get; set; } = ArraySegment<string>.Empty.ToArray();

public string[] Groups { get; set; } = ArraySegment<string>.Empty.ToArray();

public string[] GetGroups()
{
if (Groups.Length == 0)
{
return ["*"];
}

return Groups;
}

public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
Expand Down
2 changes: 1 addition & 1 deletion DependencyUpdated/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private static async Task RunApplication(Options options)

var uniqueListOfDependencies = allDepencenciesToUpdate.DistinctBy(x => x.Name).ToList();

foreach (var group in configEntry.Groups)
foreach (var group in configEntry.GetGroups())
{
var matchesForGroup = uniqueListOfDependencies
.Where(x => FileSystemName.MatchesSimpleExpression(group, x.Name)).ToArray();
Expand Down

0 comments on commit 019bba1

Please sign in to comment.