mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
define plugin metadata file name as constant
This commit is contained in:
parent
4abc9d8551
commit
0ddd7f24f4
4 changed files with 8 additions and 8 deletions
|
|
@ -1,8 +1,9 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using Flow.Launcher.Infrastructure;
|
||||||
using Flow.Launcher.Infrastructure.Logger;
|
using Flow.Launcher.Infrastructure.Logger;
|
||||||
using Flow.Launcher.Plugin;
|
using Flow.Launcher.Plugin;
|
||||||
|
|
||||||
|
|
@ -11,8 +12,6 @@ namespace Flow.Launcher.Core.Plugin
|
||||||
|
|
||||||
internal abstract class PluginConfig
|
internal abstract class PluginConfig
|
||||||
{
|
{
|
||||||
private const string PluginConfigName = "plugin.json";
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Parse plugin metadata in the given directories
|
/// Parse plugin metadata in the given directories
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -52,7 +51,7 @@ namespace Flow.Launcher.Core.Plugin
|
||||||
|
|
||||||
private static PluginMetadata GetPluginMetadata(string pluginDirectory)
|
private static PluginMetadata GetPluginMetadata(string pluginDirectory)
|
||||||
{
|
{
|
||||||
string configPath = Path.Combine(pluginDirectory, PluginConfigName);
|
string configPath = Path.Combine(pluginDirectory, Constant.PluginMetadataFileName);
|
||||||
if (!File.Exists(configPath))
|
if (!File.Exists(configPath))
|
||||||
{
|
{
|
||||||
Log.Error($"|PluginConfig.GetPluginMetadata|Didn't find config file <{configPath}>");
|
Log.Error($"|PluginConfig.GetPluginMetadata|Didn't find config file <{configPath}>");
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ using System.Windows;
|
||||||
using ICSharpCode.SharpZipLib.Zip;
|
using ICSharpCode.SharpZipLib.Zip;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Flow.Launcher.Plugin;
|
using Flow.Launcher.Plugin;
|
||||||
|
using Flow.Launcher.Infrastructure;
|
||||||
using Flow.Launcher.Infrastructure.Logger;
|
using Flow.Launcher.Infrastructure.Logger;
|
||||||
|
|
||||||
namespace Flow.Launcher.Core.Plugin
|
namespace Flow.Launcher.Core.Plugin
|
||||||
|
|
@ -21,7 +22,7 @@ namespace Flow.Launcher.Core.Plugin
|
||||||
}
|
}
|
||||||
UnZip(path, tempFoler, true);
|
UnZip(path, tempFoler, true);
|
||||||
|
|
||||||
string iniPath = Path.Combine(tempFoler, "plugin.json");
|
string iniPath = Path.Combine(tempFoler, Constant.PluginMetadataFileName);
|
||||||
if (!File.Exists(iniPath))
|
if (!File.Exists(iniPath))
|
||||||
{
|
{
|
||||||
MessageBox.Show("Install failed: plugin config is missing");
|
MessageBox.Show("Install failed: plugin config is missing");
|
||||||
|
|
@ -95,7 +96,7 @@ namespace Flow.Launcher.Core.Plugin
|
||||||
|
|
||||||
private static PluginMetadata GetMetadataFromJson(string pluginDirectory)
|
private static PluginMetadata GetMetadataFromJson(string pluginDirectory)
|
||||||
{
|
{
|
||||||
string configPath = Path.Combine(pluginDirectory, "plugin.json");
|
string configPath = Path.Combine(pluginDirectory, Constant.PluginMetadataFileName);
|
||||||
PluginMetadata metadata;
|
PluginMetadata metadata;
|
||||||
|
|
||||||
if (!File.Exists(configPath))
|
if (!File.Exists(configPath))
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ namespace Flow.Launcher.Infrastructure
|
||||||
{
|
{
|
||||||
public const string FlowLauncher = "Flow.Launcher";
|
public const string FlowLauncher = "Flow.Launcher";
|
||||||
public const string Plugins = "Plugins";
|
public const string Plugins = "Plugins";
|
||||||
|
public const string PluginMetadataFileName = "plugin.json";
|
||||||
|
|
||||||
public const string ApplicationFileName = FlowLauncher + ".exe";
|
public const string ApplicationFileName = FlowLauncher + ".exe";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
@ -17,7 +17,6 @@ namespace Flow.Launcher.Plugin.PluginManagement
|
||||||
public class Main : IPlugin, IPluginI18n
|
public class Main : IPlugin, IPluginI18n
|
||||||
{
|
{
|
||||||
private static string APIBASE = "http://api.wox.one";
|
private static string APIBASE = "http://api.wox.one";
|
||||||
private static string PluginConfigName = "plugin.json";
|
|
||||||
private static string pluginSearchUrl = APIBASE + "/plugin/search/";
|
private static string pluginSearchUrl = APIBASE + "/plugin/search/";
|
||||||
private const string ListCommand = "list";
|
private const string ListCommand = "list";
|
||||||
private const string InstallCommand = "install";
|
private const string InstallCommand = "install";
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue