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,8 +22,14 @@ namespace Wabbajack.Lib.CompilationSteps
|
|||||||
|
|
||||||
public override async ValueTask<Directive> Run(RawSourceFile source)
|
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());
|
||||||
return null;
|
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 mod_ini = ((MO2Compiler)_compiler).ModMetas.FirstOrDefault(f => source.Path.StartsWith(f.Key));
|
||||||
var installationFile = mod_ini.Value?.General?.installationFile;
|
var installationFile = mod_ini.Value?.General?.installationFile;
|
||||||
|
@ -185,12 +185,15 @@ namespace Wabbajack.Test
|
|||||||
|
|
||||||
public void VerifyAllFiles()
|
public void VerifyAllFiles()
|
||||||
{
|
{
|
||||||
|
var skip_files = new HashSet<string> {"portable.txt"};
|
||||||
foreach (var dest_file in Directory.EnumerateFiles(InstallFolder, "*", DirectoryEnumerationOptions.Recursive))
|
foreach (var dest_file in Directory.EnumerateFiles(InstallFolder, "*", DirectoryEnumerationOptions.Recursive))
|
||||||
{
|
{
|
||||||
var rel_file = dest_file.RelativeTo(InstallFolder);
|
var rel_file = dest_file.RelativeTo(InstallFolder);
|
||||||
if (rel_file.StartsWith(Consts.LOOTFolderFilesDir) || rel_file.StartsWith(Consts.GameFolderFilesDir))
|
if (rel_file.StartsWith(Consts.LOOTFolderFilesDir) || rel_file.StartsWith(Consts.GameFolderFilesDir))
|
||||||
continue;
|
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"};
|
var skip_extensions = new HashSet<string> {".txt", ".ini"};
|
||||||
|
@ -73,6 +73,8 @@ namespace Wabbajack.Test
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var modlist = await CompileAndInstall(profile);
|
var modlist = await CompileAndInstall(profile);
|
||||||
var directive = modlist.Directives.Where(m => m.To == $"mods\\{moddest}\\merged.esp").FirstOrDefault();
|
var directive = modlist.Directives.Where(m => m.To == $"mods\\{moddest}\\merged.esp").FirstOrDefault();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user