fix LOOT directory not found error

This commit is contained in:
Timothy Baldridge 2019-09-23 22:34:21 -06:00
parent 7e501a1c2d
commit 9d225ff518
2 changed files with 15 additions and 6 deletions

View File

@ -7,6 +7,8 @@
* Only sync the VFS cache when it changes.
* Fix a crash in GroupedByArchive()
* Detect and zEdit Merges and include binary patches for merges (no install support yet)
* Add unit/integration tests.
* Don't assume *everyone* has LOOT
#### Version 0.9.2 - 9/18/2013
* Fixed a bug with BSA string encoding

View File

@ -138,13 +138,20 @@ namespace Wabbajack
var loot_path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
"LOOT");
Info($"Indexing {loot_path}");
VFS.AddRoot(loot_path);
// TODO: make this generic so we can add more paths
IEnumerable<RawSourceFile> loot_files = new List<RawSourceFile>();
if (Directory.Exists(loot_path))
{
Info($"Indexing {loot_path}");
VFS.AddRoot(loot_path);
loot_files = Directory.EnumerateFiles(loot_path, "userlist.yaml", SearchOption.AllDirectories)
.Where(p => p.FileExists())
.Select(p => new RawSourceFile(VFS.Lookup(p))
{ Path = Path.Combine(Consts.LOOTFolderFilesDir, p.RelativeTo(loot_path)) });
}
var loot_files = Directory.EnumerateFiles(loot_path, "userlist.yaml", SearchOption.AllDirectories)
.Where(p => p.FileExists())
.Select(p => new RawSourceFile(VFS.Lookup(p))
{Path = Path.Combine(Consts.LOOTFolderFilesDir, p.RelativeTo(loot_path))});
Info("Indexing Archives");