PluginsManager: fix "new issue" URL for some plugins

since the `UrlSourceCode` field is inconsistent in the manifest file
This commit is contained in:
Ioannis G 2022-01-11 06:49:56 +02:00
parent 35e043859c
commit daedc03008
No known key found for this signature in database
GPG key ID: EAC0E4E5E36AC49E

View file

@ -2,7 +2,7 @@
using Flow.Launcher.Infrastructure.UserSettings; using Flow.Launcher.Infrastructure.UserSettings;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text.RegularExpressions;
namespace Flow.Launcher.Plugin.PluginsManager 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 // 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") var link = pluginManifestInfo.UrlSourceCode.StartsWith("https://github.com")
? pluginManifestInfo.UrlSourceCode.Replace("/tree/master", "/issues/new/choose") ? Regex.Replace(pluginManifestInfo.UrlSourceCode, @"\/tree\/\w+$", "") + "/issues/new/choose"
: pluginManifestInfo.UrlSourceCode; : pluginManifestInfo.UrlSourceCode;
Context.API.OpenUrl(link); Context.API.OpenUrl(link);
return true; return true;