From 0b538c5db6bc6c4455e88d0323ff5670af3e18ae Mon Sep 17 00:00:00 2001 From: goat <16760685+goaaats@users.noreply.github.com> Date: Wed, 28 Apr 2021 18:01:45 +0200 Subject: [PATCH] feat: also clean up latest plugin version if disabled --- Dalamud/Plugin/PluginRepository.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dalamud/Plugin/PluginRepository.cs b/Dalamud/Plugin/PluginRepository.cs index d1925c0f3..7bbe79838 100644 --- a/Dalamud/Plugin/PluginRepository.cs +++ b/Dalamud/Plugin/PluginRepository.cs @@ -346,15 +346,15 @@ namespace Dalamud.Plugin if (!success) { Log.Debug("Unparseable version: {0}", dirInfo.Name); } return version; }).ToArray(); - for (var i = 0; i < sortedVersions.Length - 1; i++) { + for (var i = 0; i < sortedVersions.Length; i++) { var disabledFile = new FileInfo(Path.Combine(sortedVersions[i].FullName, ".disabled")); if (disabledFile.Exists) { - Log.Information("[PLUGINR] Trying to delete old {0} at {1}", installed.Name, sortedVersions[i].FullName); + Log.Information("[PLUGINR] Trying to clean up {0} at {1}", installed.Name, sortedVersions[i].FullName); try { sortedVersions[i].Delete(true); } catch (Exception ex) { - Log.Error(ex, "[PLUGINR] Could not delete old version"); + Log.Error(ex, $"[PLUGINR] Could not clean up {disabledFile.FullName}"); } } }