mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
28 lines
819 B
C#
28 lines
819 B
C#
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using Wabbajack.Common;
|
|
|
|
namespace Wabbajack.Lib.CompilationSteps
|
|
{
|
|
public class IgnoreSaveFiles : MO2CompilationStep
|
|
{
|
|
private AbsolutePath[] _profilePaths;
|
|
|
|
public IgnoreSaveFiles(ACompiler compiler) : base(compiler)
|
|
{
|
|
_profilePaths =
|
|
MO2Compiler.SelectedProfiles.Select(p => MO2Compiler.MO2Folder.Combine("profiles", p, "saves")).ToArray();
|
|
}
|
|
|
|
public override async ValueTask<Directive?> Run(RawSourceFile source)
|
|
{
|
|
if (!_profilePaths.Any(p => source.File.AbsoluteName.InFolder(p)))
|
|
return null;
|
|
|
|
var result = source.EvolveTo<IgnoredDirectly>();
|
|
result.Reason = "Ignore Save files";
|
|
return result;
|
|
}
|
|
}
|
|
}
|