From daedc030083c7e38c5fb2f3a01ae64ab027cff71 Mon Sep 17 00:00:00 2001 From: Ioannis G Date: Tue, 11 Jan 2022 06:49:56 +0200 Subject: [PATCH] PluginsManager: fix "new issue" URL for some plugins since the `UrlSourceCode` field is inconsistent in the manifest file --- Plugins/Flow.Launcher.Plugin.PluginsManager/ContextMenu.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/ContextMenu.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/ContextMenu.cs index a20e5a267..37f0a126e 100644 --- a/Plugins/Flow.Launcher.Plugin.PluginsManager/ContextMenu.cs +++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/ContextMenu.cs @@ -2,7 +2,7 @@ using Flow.Launcher.Infrastructure.UserSettings; using System; using System.Collections.Generic; -using System.Text; +using System.Text.RegularExpressions; namespace Flow.Launcher.Plugin.PluginsManager { @@ -53,8 +53,8 @@ namespace Flow.Launcher.Plugin.PluginsManager { // standard UrlSourceCode format in PluginsManifest's plugins.json file: https://github.com/jjw24/Flow.Launcher.Plugin.Putty/tree/master var link = pluginManifestInfo.UrlSourceCode.StartsWith("https://github.com") - ? pluginManifestInfo.UrlSourceCode.Replace("/tree/master", "/issues/new/choose") - : pluginManifestInfo.UrlSourceCode; + ? Regex.Replace(pluginManifestInfo.UrlSourceCode, @"\/tree\/\w+$", "") + "/issues/new/choose" + : pluginManifestInfo.UrlSourceCode; Context.API.OpenUrl(link); return true;