wip git init, add, commit

This commit is contained in:
Collin M. Barrett 2019-06-28 16:29:50 -05:00
parent e96badf1de
commit a35b1e9379

View file

@ -1,8 +1,10 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using FilterLists.Agent.Entities;
using FilterLists.Agent.Infrastructure;
using LibGit2Sharp;
using MediatR;
using RestSharp;
@ -27,11 +29,19 @@ public Handler(IFilterListsApiClient apiClient, IMediator mediator)
protected override async Task Handle(Command request, CancellationToken cancellationToken)
{
//TODO: git init if repo doesn't exist
const string workingDirectoryPath = @"archives";
var lists = await GetListInfo();
await _mediator.Send(new DownloadLists.Command(lists), cancellationToken);
//TODO: git add .
//TODO: git commit
using (var repo = new Repository(workingDirectoryPath))
{
Commands.Stage(repo, "*");
var author = new Signature("James", "@jugglingnutcase", DateTime.UtcNow);
var committer = author;
var commit = repo.Commit("Here's a commit i made!", author, committer);
}
}
private async Task<IEnumerable<ListInfo>> GetListInfo()