32 lines
973 B
C#
32 lines
973 B
C#
using System.CommandLine;
|
|
using MycroForge.CLI.Features;
|
|
using MycroForge.Core;
|
|
using MycroForge.Core.Contract;
|
|
|
|
namespace MycroForge.CLI.Commands;
|
|
|
|
public partial class MycroForge
|
|
{
|
|
public partial class Add
|
|
{
|
|
public class Git : Command, ISubCommandOf<Add>
|
|
{
|
|
private readonly ProjectContext _context;
|
|
private readonly List<IFeature> _features;
|
|
|
|
public Git(ProjectContext context, IEnumerable<IFeature> features) :
|
|
base(Features.Git.FeatureName, "Add git to the project")
|
|
{
|
|
_context = context;
|
|
_features = features.ToList();
|
|
this.SetHandler(ExecuteAsync);
|
|
}
|
|
|
|
private async Task ExecuteAsync()
|
|
{
|
|
var feature = _features.First(f => f.Name == Features.Git.FeatureName);
|
|
await feature.ExecuteAsync(_context);
|
|
}
|
|
}
|
|
}
|
|
} |