mirror of
https://github.com/Pathoschild/SMAPI.git
synced 2026-10-11 22:19:56 +00:00
fix mod blacklist update failing if the new version is shorter
Previously `blacklist-update.json` was updated using `File.OpenWrite`, which doesn't truncate before overwriting. If the previous version was longer, that left the longer part at the end of the file.
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
* Improved performance.
|
||||
* Improved error message when a mod is blocked by Windows Smart App Control.
|
||||
* Improved translations. Thanks to To2morrow (updated Korean)!
|
||||
* Fixed rare edge case where a mod blacklist update could fail.
|
||||
* Updated internal mod blacklist.
|
||||
|
||||
* For mod authors:
|
||||
|
||||
@@ -1840,7 +1840,7 @@ internal class SCore : IDisposable
|
||||
|
||||
// save new file
|
||||
await using (Stream downloadStream = await newData.AsStream())
|
||||
await using (FileStream stream = File.OpenWrite(Constants.ApiBlacklistFetchedPath))
|
||||
await using (FileStream stream = File.Create(Constants.ApiBlacklistFetchedPath))
|
||||
await downloadStream.CopyToAsync(stream);
|
||||
|
||||
this.Monitor.Log($" Mod blacklist updated to match the server (updated from {localHash} to {serverHash}). The changes will take effect on the next SMAPI launch.");
|
||||
|
||||
Reference in New Issue
Block a user