mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
fix(archival): 🐛 validate git repo vs just directory existence
This commit is contained in:
parent
5a2cf4caf1
commit
8247982aef
1 changed files with 2 additions and 3 deletions
|
|
@ -1,5 +1,4 @@
|
|||
using System.Linq;
|
||||
using FilterLists.Archival.Domain.ListArchives;
|
||||
using FilterLists.Archival.Domain.ListArchives;
|
||||
using FilterLists.Archival.Infrastructure.Options;
|
||||
using LibGit2Sharp;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
|
@ -15,7 +14,7 @@ public static void AddPersistenceServices(this IServiceCollection services, ICon
|
|||
services.AddTransient<IRepository, Repository>(_ =>
|
||||
{
|
||||
var gitOptions = configuration.GetSection(GitOptions.Key).Get<GitOptions>();
|
||||
if (!System.IO.Directory.EnumerateFileSystemEntries(gitOptions.RepositoryPath).Any())
|
||||
if (!Repository.IsValid(gitOptions.RepositoryPath))
|
||||
{
|
||||
Repository.Init(gitOptions.RepositoryPath);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue