From 26da801f83f33803b6496c85ea2f7ec0800cb5a2 Mon Sep 17 00:00:00 2001 From: murdle Date: Fri, 2 May 2025 07:52:06 -0700 Subject: [PATCH] delete old versions --- RobloxLegacy/VersionManager.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/RobloxLegacy/VersionManager.cs b/RobloxLegacy/VersionManager.cs index fd16f50..0ce7b72 100644 --- a/RobloxLegacy/VersionManager.cs +++ b/RobloxLegacy/VersionManager.cs @@ -81,7 +81,6 @@ public class VersionManager : IDisposable public async Task InstallPackage() { var version = await GetLatestVersion(); - if (version == null) throw new Exception("No version data found"); if (version.UploadHash == _currentVersion) @@ -105,6 +104,9 @@ public class VersionManager : IDisposable Logger.Error($"Failed to download {file.Key}"); } } + + if(_currentVersion != null) + Directory.Delete(GetVersionPath(_currentVersion), true); _currentVersion = version.UploadHash; WriteAppSettings();