using System.Threading.Tasks; using Newtonsoft.Json; namespace Wabbajack.Lib.CompilationSteps { public class IgnorePathContains : ACompilationStep { private readonly string _pattern; private readonly string _reason; public IgnorePathContains(ACompiler compiler, string pattern) : base(compiler) { _pattern = $"\\{pattern.Trim('\\')}\\"; _reason = $"Ignored because path contains {_pattern}"; } public override async ValueTask Run(RawSourceFile source) { if (!((string)source.Path).Contains(_pattern)) return null; var result = source.EvolveTo(); result.Reason = _reason; return result; } } }