diff --git a/Wabbajack.Lib/CompilationSteps/IgnoreExtension.cs b/Wabbajack.Lib/CompilationSteps/IgnoreExtension.cs new file mode 100644 index 00000000..db93aea6 --- /dev/null +++ b/Wabbajack.Lib/CompilationSteps/IgnoreExtension.cs @@ -0,0 +1,27 @@ +using System.Threading.Tasks; +using Wabbajack.Common; + +namespace Wabbajack.Lib.CompilationSteps +{ + public class IgnoreExtension : ACompilationStep + { + private readonly Extension _ext; + private readonly string _reason; + + public IgnoreExtension(ACompiler compiler, Extension ext) : base(compiler) + { + _ext = ext; + _reason = $"Ignoring {_ext} files"; + } + + public override async ValueTask Run(RawSourceFile source) + { + if (source.Path.Extension != _ext) + return null; + + var result = source.EvolveTo(); + result.Reason = _reason; + return result; + } + } +} diff --git a/Wabbajack.Lib/MO2Compiler.cs b/Wabbajack.Lib/MO2Compiler.cs index 6632fe86..91971f6b 100644 --- a/Wabbajack.Lib/MO2Compiler.cs +++ b/Wabbajack.Lib/MO2Compiler.cs @@ -479,6 +479,7 @@ namespace Wabbajack.Lib new zEditIntegration.IncludeZEditPatches(this), new IncludeTaggedMods(this, Consts.WABBAJACK_NOMATCH_INCLUDE), new IgnorePathContains(this,@"\Edit Scripts\Export\"), + new IgnoreExtension(this, new Extension(".CACHE")), new DropAll(this) }; }