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.
 
 
 
 

23 lines
596 B

using System.IO;
using System.Linq;
namespace IPA.Injector.Backups
{
internal static 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;
}
}
}