Readded a nuked feature

Was originally from this commit: 7fba212ba3
This commit is contained in:
Justin Swanson 2020-05-11 17:14:45 -05:00
parent 40640dff5a
commit 84b27b2a9c

View File

@ -39,10 +39,17 @@ namespace Wabbajack.Lib.CompilationSteps
return new State();
}
private static async Task<byte[]> ReadAndCleanModlist(AbsolutePath absolutePath)
{
var lines = await absolutePath.ReadAllLinesAsync();
lines = lines.Where(line => !(line.StartsWith("-") && !line.EndsWith("_separator"))).ToArray();
private async Task<byte[]> ReadAndCleanModlist(AbsolutePath absolutePath)
{
var alwaysEnabled = _mo2Compiler.ModInis.Where(f => IgnoreDisabledMods.IsAlwaysEnabled(f.Value))
.Select(f => f.Key)
.Distinct();
var lines = File.ReadAllLines(absolutePath.ToString()).Where(l =>
{
return l.StartsWith("+")
|| alwaysEnabled.Any(x => x.Equals(l.Substring(1)))
|| l.EndsWith("_separator");
}).ToArray();
return Encoding.UTF8.GetBytes(string.Join("\r\n", lines));
}