Install compile install works for SMEFT

This commit is contained in:
Timothy Baldridge 2022-05-30 15:02:54 -06:00
parent 8d1810355b
commit 72be066bbf
2 changed files with 16 additions and 9 deletions

View File

@ -89,17 +89,17 @@ public class InstallCompileInstallVerify : IVerb
_logger.LogInformation("Inferring settings");
var inferedSettings = await _inferencer.InferFromRootPath(installPath);
if (inferedSettings == null)
var inferredSettings = await _inferencer.InferFromRootPath(installPath);
if (inferredSettings == null)
{
_logger.LogInformation("Error inferencing settings for {MachineUrl}", machineUrl);
return 2;
}
inferedSettings.UseGamePaths = true;
inferredSettings.UseGamePaths = true;
var compiler = MO2Compiler.Create(_serviceProvider, inferedSettings);
var compiler = MO2Compiler.Create(_serviceProvider, inferredSettings);
result = await compiler.Begin(token);
if (!result)
return result ? 0 : 3;
@ -109,7 +109,7 @@ public class InstallCompileInstallVerify : IVerb
var comparison = await StandardInstaller.LoadFromFile(_dtos, wabbajackPath);
var modlist2 = await StandardInstaller.LoadFromFile(_dtos, inferedSettings.OutputFile);
var modlist2 = await StandardInstaller.LoadFromFile(_dtos, inferredSettings.OutputFile);
if (CompareModlists(comparison, modlist2))
return 3;
@ -119,7 +119,7 @@ public class InstallCompileInstallVerify : IVerb
Install = installPath2,
ModList = modlist2,
Game = modlist2.GameType,
ModlistArchive = inferedSettings.OutputFile,
ModlistArchive = inferredSettings.OutputFile,
GameFolder = _gameLocator.GameLocation(modlist2.GameType)
});
@ -143,6 +143,8 @@ public class InstallCompileInstallVerify : IVerb
var found = false;
foreach (var missing in aDirectives.Where(ad => !bDirectives.ContainsKey(ad.Key)))
{
if (missing.Key.Extension == Ext.Meta)
continue;
_logger.LogWarning("File {To} is missing in recompiled list", missing.Key);
found = true;
}

View File

@ -72,7 +72,8 @@ public class CompilerSettingsInferencer
_logger.LogInformation("Finding Always Enabled mods");
cs.AlwaysEnabled = Array.Empty<RelativePath>();
// Find Always Enabled mods
// Find mod tags
foreach (var modFolder in mo2Folder.Combine("mods").EnumerateDirectories())
{
var iniFile = modFolder.Combine("meta.ini");
@ -80,9 +81,13 @@ public class CompilerSettingsInferencer
var data = iniFile.LoadIniFile();
var generalModData = data["General"];
if ((generalModData["notes"]?.Contains("WABBAJACK_ALWAYS_ENABLE") ?? false) ||
(generalModData["comments"]?.Contains("WABBAJACK_ALWAYS_ENABLE") ?? false))
if ((generalModData["notes"]?.Contains(Consts.WABBAJACK_ALWAYS_ENABLE) ?? false) ||
(generalModData["comments"]?.Contains(Consts.WABBAJACK_ALWAYS_ENABLE) ?? false))
cs.AlwaysEnabled = cs.AlwaysEnabled.Append(modFolder.RelativeTo(mo2Folder)).ToArray();
if ((generalModData["notes"]?.Contains(Consts.WABBAJACK_NOMATCH_INCLUDE) ?? false) ||
(generalModData["comments"]?.Contains(Consts.WABBAJACK_NOMATCH_INCLUDE) ?? false))
cs.NoMatchInclude = cs.NoMatchInclude.Append(modFolder.RelativeTo(mo2Folder)).ToArray();
}
_logger.LogInformation("Finding other profiles");