mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Can install Basic Fixes.exe with the new VFS backend
This commit is contained in:
parent
e24d29e93d
commit
b91e7348b7
@ -140,6 +140,7 @@ namespace VFS
|
||||
{
|
||||
_files.Values
|
||||
.Select(f => f.ParentPath)
|
||||
.Where(s => s != null)
|
||||
.Where(s => !_files.ContainsKey(s))
|
||||
.ToHashSet()
|
||||
.Do(s =>
|
||||
@ -252,7 +253,10 @@ namespace VFS
|
||||
|
||||
public void Stage(IEnumerable<VirtualFile> files)
|
||||
{
|
||||
var grouped = files.GroupBy(f => f.ParentArchive)
|
||||
var grouped = files.SelectMany(f => f.FilesInPath)
|
||||
.Distinct()
|
||||
.Where(f => f.ParentArchive != null)
|
||||
.GroupBy(f => f.ParentArchive)
|
||||
.OrderBy(f => f.Key == null ? 0 : f.Key.Paths.Length)
|
||||
.ToList();
|
||||
|
||||
@ -565,6 +569,16 @@ namespace VFS
|
||||
path_copy[0] = VirtualFileSystem.VFS.Lookup(Paths[0]).Hash;
|
||||
return path_copy;
|
||||
}
|
||||
|
||||
public IEnumerable<VirtualFile> FilesInPath
|
||||
{
|
||||
get {
|
||||
return Enumerable.Range(1, Paths.Length)
|
||||
.Select(i => Paths.Take(i))
|
||||
.Select(path => VirtualFileSystem.VFS.Lookup(String.Join("|", path)));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -117,8 +117,8 @@ namespace Wabbajack
|
||||
{
|
||||
HashedArchives.Do(a => VFS.AddKnown(new VirtualFile()
|
||||
{
|
||||
Paths = new string[] { a.Key },
|
||||
Hash = a.Value
|
||||
Paths = new string[] { a.Value },
|
||||
Hash = a.Key
|
||||
}));
|
||||
VFS.RefreshIndexes();
|
||||
|
||||
@ -127,7 +127,7 @@ namespace Wabbajack
|
||||
.OfType<FromArchive>()
|
||||
.Do(f =>
|
||||
{
|
||||
var updated_path = new string[f.ArchiveHashPath.Length + 1];
|
||||
var updated_path = new string[f.ArchiveHashPath.Length];
|
||||
f.ArchiveHashPath.CopyTo(updated_path, 0);
|
||||
updated_path[0] = VFS.HashIndex[updated_path[0]].Where(e => e.IsConcrete).First().FullPath;
|
||||
VFS.AddKnown(new VirtualFile() { Paths = updated_path });
|
||||
@ -174,8 +174,11 @@ namespace Wabbajack
|
||||
}
|
||||
});
|
||||
|
||||
Info($"Removing temp folder {Consts.BSACreationDir}");
|
||||
Directory.Delete(Path.Combine(Outputfolder, Consts.BSACreationDir), true);
|
||||
if (Directory.Exists(Consts.BSACreationDir))
|
||||
{
|
||||
Info($"Removing temp folder {Consts.BSACreationDir}");
|
||||
Directory.Delete(Path.Combine(Outputfolder, Consts.BSACreationDir), true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user