forked from GitTools/GitVersion
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNormalizeCommand.cs
More file actions
20 lines (16 loc) · 797 Bytes
/
Copy pathNormalizeCommand.cs
File metadata and controls
20 lines (16 loc) · 797 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
using GitVersion.Extensions;
using Microsoft.Extensions.Logging;
namespace GitVersion.Commands;
public record NormalizeSettings : GitVersionSettings;
[Command("normalize", "Normalizes the git repository for GitVersion calculations.")]
public class NormalizeCommand(ILogger<NormalizeCommand> logger, IService service) : ICommand<NormalizeSettings>
{
private readonly ILogger logger = logger.NotNull();
private readonly IService service = service.NotNull();
public Task<int> InvokeAsync(NormalizeSettings settings, CancellationToken cancellationToken = default)
{
var value = this.service.Call();
this.logger.LogInformation($"Command : 'normalize', LogFile : '{settings.LogFile}', WorkDir : '{settings.WorkDir}' ");
return Task.FromResult(value);
}
}