mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Move where we include ini additions
This commit is contained in:
parent
3db1f2d9ea
commit
c73116a465
@ -100,7 +100,7 @@ namespace Wabbajack.Lib.Downloaders
|
||||
|
||||
public string GetMetaIniString()
|
||||
{
|
||||
return $"{string.Join("\n", GetMetaIni())}\ninstalled=true";
|
||||
return string.Join("\n", GetMetaIni());
|
||||
}
|
||||
|
||||
public async Task<(Archive? Archive, TempFile NewFile)> ServerFindUpgrade(Archive a)
|
||||
|
@ -252,14 +252,34 @@ namespace Wabbajack.Lib
|
||||
.OfType<ArchiveMeta>()
|
||||
.PMap(Queue, async directive =>
|
||||
{
|
||||
Status($"Writing included .meta file {directive.To}");
|
||||
var outPath = DownloadFolder.Combine(directive.To);
|
||||
if (outPath.IsFile) await outPath.DeleteAsync();
|
||||
var bytes = await LoadBytesFromPath(directive.SourceDataID);
|
||||
await outPath.WriteAllBytesAsync(bytes);
|
||||
Status($"Writing .meta file {directive.To}");
|
||||
foreach (var archive in ModList.Archives)
|
||||
{
|
||||
if (HashedArchives.TryGetValue(archive.Hash, out var paths))
|
||||
{
|
||||
var metaPath = paths.WithExtension(Consts.MetaFileExtension);
|
||||
if (!metaPath.Exists)
|
||||
{
|
||||
var meta = AddInstalled(archive.State.GetMetaIni()).ToArray();
|
||||
await metaPath.WriteAllLinesAsync(meta);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private IEnumerable<string> AddInstalled(string[] getMetaIni)
|
||||
{
|
||||
foreach (var f in getMetaIni)
|
||||
{
|
||||
yield return f;
|
||||
if (f == "[General]")
|
||||
{
|
||||
yield return "installed=true";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async ValueTask ValidateGameESMs()
|
||||
{
|
||||
foreach (var esm in ModList.Directives.OfType<CleanedESM>().ToList())
|
||||
|
Loading…
Reference in New Issue
Block a user