diff options
Diffstat (limited to 'src/SMAPI/Program.cs')
-rw-r--r-- | src/SMAPI/Program.cs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/SMAPI/Program.cs b/src/SMAPI/Program.cs index 4ede45d5..350a6195 100644 --- a/src/SMAPI/Program.cs +++ b/src/SMAPI/Program.cs @@ -428,6 +428,20 @@ namespace StardewModdingAPI // load mods this.LoadMods(mods, this.JsonHelper, this.ContentCore, modDatabase); + // write metadata file + if (this.Settings.DumpMetadata) + { + ModFolderExport export = new ModFolderExport + { + Exported = DateTime.UtcNow.ToString("O"), + ApiVersion = Constants.ApiVersion.ToString(), + GameVersion = Constants.GameVersion.ToString(), + ModFolderPath = Constants.ModPath, + Mods = mods + }; + this.JsonHelper.WriteJsonFile(Path.Combine(Constants.LogDir, $"{Constants.LogNamePrefix}.metadata-dump.json"), export); + } + // check for updates this.CheckForUpdatesAsync(mods); } @@ -1276,7 +1290,7 @@ namespace StardewModdingAPI if (!logsDir.Exists) return; - foreach (FileInfo logFile in logsDir.EnumerateFiles("*.txt")) + foreach (FileInfo logFile in logsDir.EnumerateFiles()) { if (logFile.Name.StartsWith(Constants.LogNamePrefix, StringComparison.InvariantCultureIgnoreCase)) { |