From 7bb828296177a07aafe55092df46f6f18a2f85ef Mon Sep 17 00:00:00 2001 From: Luca Date: Mon, 3 May 2021 19:04:04 +0200 Subject: [PATCH 1/2] fixed .txt based tagfiles --- Wabbajack.Lib/CompilationSteps/IgnoreTaggedFiles.cs | 8 ++++---- Wabbajack.Lib/CompilationSteps/IncludeTaggedFiles.cs | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Wabbajack.Lib/CompilationSteps/IgnoreTaggedFiles.cs b/Wabbajack.Lib/CompilationSteps/IgnoreTaggedFiles.cs index 2b20f032..4b7f0571 100644 --- a/Wabbajack.Lib/CompilationSteps/IgnoreTaggedFiles.cs +++ b/Wabbajack.Lib/CompilationSteps/IgnoreTaggedFiles.cs @@ -10,7 +10,7 @@ namespace Wabbajack.Lib.CompilationSteps { public class IgnoreTaggedFiles : ACompilationStep { - private readonly List _ignoreList = new List(); + private List _ignoreList = new List(); private List _tagFiles; private readonly string _tag; private readonly ACompiler _aCompiler; @@ -18,13 +18,13 @@ namespace Wabbajack.Lib.CompilationSteps private readonly string _reason; public IgnoreTaggedFiles(ACompiler compiler, string tag) : base(compiler) - { + { _aCompiler = (ACompiler)compiler; _sourcePath = _aCompiler.SourcePath; _tag = tag; string rootDirectory = (string)_sourcePath; - _reason = $"Ignored because folder was tagged with {_tag}"; + _reason = $"Ignored because folder/file was tagged with {_tag}"; _tagFiles = Directory.EnumerateFiles(rootDirectory, _tag, SearchOption.AllDirectories) .Select(str => (AbsolutePath)str) @@ -48,7 +48,7 @@ namespace Wabbajack.Lib.CompilationSteps { foreach (var folderpath in _ignoreList) { - if (!source.AbsolutePath.InFolder(folderpath)) continue; + if (!source.AbsolutePath.Equals(folderpath) || !source.AbsolutePath.InFolder(folderpath)) continue; var result = source.EvolveTo(); result.Reason = _reason; return result; diff --git a/Wabbajack.Lib/CompilationSteps/IncludeTaggedFiles.cs b/Wabbajack.Lib/CompilationSteps/IncludeTaggedFiles.cs index cd211e69..2126616e 100644 --- a/Wabbajack.Lib/CompilationSteps/IncludeTaggedFiles.cs +++ b/Wabbajack.Lib/CompilationSteps/IncludeTaggedFiles.cs @@ -10,7 +10,7 @@ namespace Wabbajack.Lib.CompilationSteps { public class IncludeTaggedFiles : ACompilationStep { - private readonly List _includeDirectly = new List(); + private List _includeDirectly = new List(); private List _tagFiles; private readonly string _tag; private readonly ACompiler _aCompiler; @@ -45,7 +45,7 @@ namespace Wabbajack.Lib.CompilationSteps { foreach (var folderpath in _includeDirectly) { - if (!source.AbsolutePath.InFolder(folderpath)) continue; + if (!source.AbsolutePath.Equals(folderpath) || !source.AbsolutePath.InFolder(folderpath)) continue; var result = source.EvolveTo(); result.SourceDataID = await _compiler.IncludeFile(source.AbsolutePath); return result; From 27513d3aca9b1969a6c9d624394b3bfe49fd4712 Mon Sep 17 00:00:00 2001 From: Luca Date: Sun, 9 May 2021 12:46:03 +0200 Subject: [PATCH 2/2] fixed issue with the MO2 compiler - moved `.txt` handling behind the custom flags handling - changed ignoring `.txt` files to including`.txt` files --- Wabbajack.Lib/MO2Compiler.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Wabbajack.Lib/MO2Compiler.cs b/Wabbajack.Lib/MO2Compiler.cs index f6ebced9..cae4c806 100644 --- a/Wabbajack.Lib/MO2Compiler.cs +++ b/Wabbajack.Lib/MO2Compiler.cs @@ -461,8 +461,7 @@ namespace Wabbajack.Lib // There are some types of files that will error the compilation, because they're created on-the-fly via tools // so if we don't have a match by this point, just drop them. - new IgnoreEndsWith(this, ".html"), - new IgnoreEndsWith(this, ".txt"), + new IgnoreEndsWith(this, ".html"), // Don't know why, but this seems to get copied around a bit new IgnoreEndsWith(this, "HavokBehaviorPostProcess.exe"), // Theme file MO2 downloads somehow @@ -482,6 +481,7 @@ namespace Wabbajack.Lib new IncludeTaggedMods(this, Consts.WABBAJACK_NOMATCH_INCLUDE), new IncludeTaggedFolders(this,Consts.WABBAJACK_NOMATCH_INCLUDE), new IncludeTaggedFiles(this,Consts.WABBAJACK_NOMATCH_INCLUDE_FILES), + new IncludeRegex(this, ".*\\.txt"), new IgnorePathContains(this,@"\Edit Scripts\Export\"), new IgnoreExtension(this, new Extension(".CACHE")), new DropAll(this)