Skip to content

Commit c18ae41

Browse files
Delete existing zip before downloading
1 parent af9c662 commit c18ae41

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,11 @@ internal async Task InstallOrUpdateAsync(UserPlugin plugin)
143143

144144
try
145145
{
146+
if (File.Exists(filePath))
147+
{
148+
File.Delete(filePath);
149+
}
150+
146151
await Http.DownloadAsync(plugin.UrlDownload, filePath).ConfigureAwait(false);
147152

148153
Install(plugin, filePath);
@@ -245,6 +250,11 @@ where existingPlugin.Metadata.Version.CompareTo(pluginFromManifest.Version) <
245250

246251
_ = Task.Run(async delegate
247252
{
253+
if (File.Exists(downloadToFilePath))
254+
{
255+
File.Delete(downloadToFilePath);
256+
}
257+
248258
await Http.DownloadAsync(x.PluginNewUserPlugin.UrlDownload, downloadToFilePath)
249259
.ConfigureAwait(false);
250260

0 commit comments

Comments
 (0)