fix: don't create plugin output dir before downloading

This commit is contained in:
goat 2021-08-24 14:26:12 +02:00
parent 0c52f8099e
commit 66daa03da3
No known key found for this signature in database
GPG key ID: F18F057873895461

View file

@ -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);