Merge pull request #364 from wabbajack-tools/mohidden-patch-sources

Allow .mohidden files to be patched
This commit is contained in:
Timothy Baldridge 2020-01-06 15:18:44 -08:00 committed by GitHub
commit 51388964b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 3 deletions

View File

@ -22,8 +22,14 @@ namespace Wabbajack.Lib.CompilationSteps
public override async ValueTask<Directive> Run(RawSourceFile source)
{
if (!_indexed.TryGetValue(Path.GetFileName(source.File.Name.ToLower()), out var choices))
return null;
var name = Path.GetFileName(source.File.Name.ToLower());
string nameWithoutExt = name;
if (Path.GetExtension(name) == ".mohidden")
nameWithoutExt = Path.GetFileNameWithoutExtension(name);
if (!_indexed.TryGetValue(Path.GetFileName(name), out var choices))
if (!_indexed.TryGetValue(Path.GetFileName(nameWithoutExt), out choices))
return null;
var mod_ini = ((MO2Compiler)_compiler).ModMetas.FirstOrDefault(f => source.Path.StartsWith(f.Key));
var installationFile = mod_ini.Value?.General?.installationFile;

View File

@ -185,12 +185,15 @@ namespace Wabbajack.Test
public void VerifyAllFiles()
{
var skip_files = new HashSet<string> {"portable.txt"};
foreach (var dest_file in Directory.EnumerateFiles(InstallFolder, "*", DirectoryEnumerationOptions.Recursive))
{
var rel_file = dest_file.RelativeTo(InstallFolder);
if (rel_file.StartsWith(Consts.LOOTFolderFilesDir) || rel_file.StartsWith(Consts.GameFolderFilesDir))
continue;
Assert.IsTrue(File.Exists(Path.Combine(MO2Folder, rel_file)), $"Only in Destination: {rel_file}");
if (!skip_files.Contains(Path.GetExtension(rel_file)))
Assert.IsTrue(File.Exists(Path.Combine(MO2Folder, rel_file)), $"Only in Destination: {rel_file}");
}
var skip_extensions = new HashSet<string> {".txt", ".ini"};

View File

@ -73,6 +73,8 @@ namespace Wabbajack.Test
});
var modlist = await CompileAndInstall(profile);
var directive = modlist.Directives.Where(m => m.To == $"mods\\{moddest}\\merged.esp").FirstOrDefault();