You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

27 lines
692 B

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
namespace IPA.Injector.Backups
{
public class BackupManager
{
public static BackupUnit FindLatestBackup(string dir)
{
new DirectoryInfo(dir).Create();
return new DirectoryInfo(dir)
.GetDirectories()
.OrderByDescending(p => p.Name)
.Select(p => BackupUnit.FromDirectory(p, dir))
.FirstOrDefault();
}
public static bool HasBackup(string dir)
{
return FindLatestBackup(dir) != null;
}
}
}