mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Added InlineFile Directives to the manifest
This commit is contained in:
parent
26c15d11b8
commit
73a937e8b8
@ -144,33 +144,31 @@ namespace Wabbajack.Lib
|
||||
ModList.Image = (RelativePath)"modlist-image.png";
|
||||
}
|
||||
|
||||
using (var of = await ModListOutputFolder.Combine("modlist").Create())
|
||||
await using (var of = await ModListOutputFolder.Combine("modlist").Create())
|
||||
ModList.ToJson(of);
|
||||
|
||||
await ModListOutputFile.DeleteAsync();
|
||||
|
||||
using (var fs = await ModListOutputFile.Create())
|
||||
await using (var fs = await ModListOutputFile.Create())
|
||||
{
|
||||
using (var za = new ZipArchive(fs, ZipArchiveMode.Create))
|
||||
using var za = new ZipArchive(fs, ZipArchiveMode.Create);
|
||||
await ModListOutputFolder.EnumerateFiles()
|
||||
.DoProgress("Compressing ModList",
|
||||
async f =>
|
||||
{
|
||||
await ModListOutputFolder.EnumerateFiles()
|
||||
.DoProgress("Compressing ModList",
|
||||
async f =>
|
||||
{
|
||||
var ze = za.CreateEntry((string)f.FileName);
|
||||
await using var os = ze.Open();
|
||||
await using var ins = await f.OpenRead();
|
||||
await ins.CopyToAsync(os);
|
||||
});
|
||||
var ze = za.CreateEntry((string)f.FileName);
|
||||
await using var os = ze.Open();
|
||||
await using var ins = await f.OpenRead();
|
||||
await ins.CopyToAsync(os);
|
||||
});
|
||||
|
||||
// Copy in modimage
|
||||
if (ModListImage.Exists)
|
||||
{
|
||||
var ze = za.CreateEntry((string)ModList.Image);
|
||||
await using var os = ze.Open();
|
||||
await using var ins = await ModListImage.OpenRead();
|
||||
await ins.CopyToAsync(os);
|
||||
}
|
||||
// Copy in modimage
|
||||
if (ModListImage.Exists)
|
||||
{
|
||||
var ze = za.CreateEntry((string)ModList.Image);
|
||||
await using var os = ze.Open();
|
||||
await using var ins = await ModListImage.OpenRead();
|
||||
await ins.CopyToAsync(os);
|
||||
}
|
||||
}
|
||||
|
||||
@ -186,7 +184,6 @@ namespace Wabbajack.Lib
|
||||
};
|
||||
metadata.ToJson(ModListOutputFile + ".meta.json");
|
||||
|
||||
|
||||
Utils.Log("Removing ModList staging folder");
|
||||
await Utils.DeleteDirectory(ModListOutputFolder);
|
||||
}
|
||||
|
@ -9,25 +9,26 @@ namespace Wabbajack.Lib
|
||||
[JsonName("Manifest")]
|
||||
public class Manifest
|
||||
{
|
||||
public string Name;
|
||||
public Version Version;
|
||||
public string Author;
|
||||
public string Description;
|
||||
public readonly string Name;
|
||||
public readonly Version Version;
|
||||
public readonly string Author;
|
||||
public readonly string Description;
|
||||
|
||||
public Game GameType;
|
||||
public readonly Game GameType;
|
||||
// Enum toString for better parsing in other software
|
||||
public string GameName;
|
||||
|
||||
public ModManager ModManager;
|
||||
public readonly ModManager ModManager;
|
||||
// Enum toString for better parsing in other software
|
||||
public string ModManagerName;
|
||||
|
||||
public long DownloadSize;
|
||||
public long InstallSize;
|
||||
public readonly long DownloadSize;
|
||||
public readonly long InstallSize;
|
||||
|
||||
public bool IsNSFW;
|
||||
|
||||
public List<Archive> Archives;
|
||||
public readonly List<Archive> Archives;
|
||||
public readonly List<InlineFile> InlinedFiles;
|
||||
|
||||
public Manifest(ModList modlist)
|
||||
{
|
||||
@ -54,6 +55,8 @@ namespace Wabbajack.Lib
|
||||
Name = a.Name,
|
||||
Size = a.Size,
|
||||
}).ToList();
|
||||
|
||||
InlinedFiles = modlist.Directives.OfType<InlineFile>().ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user