Skip to content

Commit

Permalink
[build] 0.3.0
Browse files Browse the repository at this point in the history
Fixed issue that would cause data loss when updating from 0.2.x
  • Loading branch information
openbullet committed Jul 1, 2024
1 parent b39f01c commit 46864af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions OpenBullet2.Native.Updater/Helpers/FileSystemHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ public static async Task CleanupInstallationFolderAsync()
{
var isDirectory = (File.GetAttributes(entry) & FileAttributes.Directory) == FileAttributes.Directory;

// If it's appsettings.json or the UserData folder, disregard it
if (entry == "appsettings.json" || entry.StartsWith("UserData"))
// If it even contains appsettings.json or UserData, disregard it (prevent accidental deletion)
if (entry.Contains("appsettings.json") || entry.Contains("UserData"))
{
continue;
}
Expand Down
6 changes: 3 additions & 3 deletions OpenBullet2.Web.Updater/Helpers/FileSystemHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ public static async Task CleanupInstallationFolderAsync()
foreach (var entry in Directory.EnumerateFileSystemEntries(Directory.GetCurrentDirectory()))
{
var isDirectory = (File.GetAttributes(entry) & FileAttributes.Directory) == FileAttributes.Directory;

// If it's appsettings.json or the UserData folder, disregard it
if (entry == "appsettings.json" || entry.StartsWith("UserData"))
// If it even contains appsettings.json or UserData, disregard it (prevent accidental deletion)
if (entry.Contains("appsettings.json") || entry.Contains("UserData"))
{
continue;
}
Expand Down

0 comments on commit 46864af

Please sign in to comment.