Browse Source

Fix deleting unpack dir not exist yet

pull/269/head
Ionite 1 year ago
parent
commit
8c9552d0b2
No known key found for this signature in database
  1. 10
      StabilityMatrix.Core/Updater/UpdateHelper.cs

10
StabilityMatrix.Core/Updater/UpdateHelper.cs

@ -80,7 +80,10 @@ public class UpdateHelper : IUpdateHelper
// Unzip if needed
if (downloadFile.Extension == ".zip")
{
await extractDir.DeleteAsync(true).ConfigureAwait(false);
if (extractDir.Exists)
{
await extractDir.DeleteAsync(true).ConfigureAwait(false);
}
extractDir.Create();
await ArchiveHelper
@ -104,7 +107,10 @@ public class UpdateHelper : IUpdateHelper
// Clean up original download
await downloadFile.DeleteAsync().ConfigureAwait(false);
// Clean up extract dir
await extractDir.DeleteAsync(true).ConfigureAwait(false);
if (extractDir.Exists)
{
await extractDir.DeleteAsync(true).ConfigureAwait(false);
}
}
}

Loading…
Cancel
Save