This commit is contained in:
Timothy Baldridge 2021-02-08 22:17:11 -07:00
parent b1adc3e6e3
commit 22f1a69550
2 changed files with 28 additions and 0 deletions

View File

@ -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<Directive?> Run(RawSourceFile source)
{
if (source.Path.Extension != _ext)
return null;
var result = source.EvolveTo<IgnoredDirectly>();
result.Reason = _reason;
return result;
}
}
}

View File

@ -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)
};
}