mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Merge pull request #364 from wabbajack-tools/mohidden-patch-sources
Allow .mohidden files to be patched
This commit is contained in:
commit
51388964b1
@ -22,7 +22,13 @@ namespace Wabbajack.Lib.CompilationSteps
|
||||
|
||||
public override async ValueTask<Directive> Run(RawSourceFile source)
|
||||
{
|
||||
if (!_indexed.TryGetValue(Path.GetFileName(source.File.Name.ToLower()), out var choices))
|
||||
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));
|
||||
|
@ -185,11 +185,14 @@ 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;
|
||||
|
||||
if (!skip_files.Contains(Path.GetExtension(rel_file)))
|
||||
Assert.IsTrue(File.Exists(Path.Combine(MO2Folder, rel_file)), $"Only in Destination: {rel_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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user