From 66daa03da3e39cef88390a300c6e794c864c4ccc Mon Sep 17 00:00:00 2001 From: goat <16760685+goaaats@users.noreply.github.com> Date: Tue, 24 Aug 2021 14:26:12 +0200 Subject: [PATCH] fix: don't create plugin output dir before downloading --- Dalamud/Plugin/Internal/PluginManager.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dalamud/Plugin/Internal/PluginManager.cs b/Dalamud/Plugin/Internal/PluginManager.cs index 73cf33f5d..ca7c69fa2 100644 --- a/Dalamud/Plugin/Internal/PluginManager.cs +++ b/Dalamud/Plugin/Internal/PluginManager.cs @@ -394,6 +394,10 @@ namespace Dalamud.Plugin.Internal var downloadUrl = useTesting ? repoManifest.DownloadLinkTesting : repoManifest.DownloadLinkInstall; var version = useTesting ? repoManifest.TestingAssemblyVersion : repoManifest.AssemblyVersion; + using var client = new HttpClient(); + var response = await client.GetAsync(downloadUrl); + response.EnsureSuccessStatusCode(); + var outputDir = new DirectoryInfo(Path.Combine(this.pluginDirectory.FullName, repoManifest.InternalName, version.ToString())); try @@ -408,10 +412,6 @@ namespace Dalamud.Plugin.Internal // ignored, since the plugin may be loaded already } - using var client = new HttpClient(); - var response = await client.GetAsync(downloadUrl); - response.EnsureSuccessStatusCode(); - Log.Debug($"Extracting to {outputDir}"); // This throws an error, even with overwrite=false // ZipFile.ExtractToDirectory(tempZip.FullName, outputDir.FullName, false);